summaryrefslogtreecommitdiff
path: root/editor.c
AgeCommit message (Collapse)Author
2023-01-30Move unsaved quit warning to editor.ccflip
2023-01-25Rename `append_buffer` to textbufcflip
This name is a little bit better I think, and it will be nice to have a distinction between this utility and the 'file' kind of buffer.
2023-01-22Remove unused `editor_draw_rows` functioncflip
This was used to draw all visible lines into a buffer to be rendered by the terminal or window, but now the window draws these lines directly.
2023-01-19Show filename and current working directory in window titlecflip
2023-01-17Allow window to be resizablecflip
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-16Implement some more commands from vimcflip
2023-01-12Clean up editor_state's memory on teardowncflip
2023-01-12Add an indicator to the status bar when in insert modecflip
2023-01-12Make the editor modal and refactor keyboard eventscflip
This makes the editor behave more like vi, with a seperate insert mode. This also refactors the keyboard input code to pass the SDL_Keysym structure to input.c and to use the SDL_TEXTINPUT event for editing text. SDL's text input event already fixes typing capital letters with shift, and should make it possible to enter text using an IME, however most unicode characters aren't properly rendered.
2023-01-12Move cursor movement into separate functionscflip
2023-01-11Remove all terminal-related codecflip
2023-01-11Get editor size from the window instead of the terminalcflip
Previously the editor would resize itself upon startup by finding the size of the current terminal window, but now that it is running in an actual window it should get the number of rows and columns from there. This also adds parameters for the window size in rows and columns to the window_init() function.
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/.