summaryrefslogtreecommitdiff
path: root/file.c
AgeCommit message (Collapse)Author
2023-01-31Reimplement editor_prompt and 'Save as' using the new prompt modeHEADmastercflip
Now there there is a new way to prompt for text, we can reimplement the long abandoned editor_prompt function and use it to allow saving to new files. The new editor_prompt function takes a callback that will be called after the user presses enter on the prompt.
2023-01-19Show filename and current working directory in window titlecflip
2023-01-17Rename 'rows' to 'lines' everywherecflip
For whatever reason lines were called rows in the code, so this refactor changes that name everywhere. The name 'row' is still used in some places to refer to the unit of height in the screen.
2023-01-16Improve behaviour when opening a file from the command linecflip
The editor had two issues when reading a file with a name from the command line. The most annoying issue was that when reallocating the internal filename in the editor, the null terminator wasn't copied which sometimes left garbage at the end of the filename. The other issue was that the editor would quit with a fatal error if there was no file with the specified name, when it should open the file anyway and just create it on save.
2023-01-12Replace call to strdup() with equivalent behaviourcflip
This was causing the editor to crash on startup when opening a file from the command line.
2023-01-11Remove all terminal-related codecflip
2023-01-08Initial import of existing source codecflip
This is based off of snaptoken's "Build Your Own Text Editor" tutorial at https://viewsourcecode.org/snaptoken/kilo/.