summaryrefslogtreecommitdiff
path: root/editor.h
AgeCommit message (Collapse)Author
2023-01-18Refactor text rendering codecflip
Previously, the editor would print visible lines plus the statusline and message bar into a buffer, then the window would display this entire buffer. This refactor makes the window directly read lines from the editor and individually display them on the screen. This will make it easier to do syntax highlighting, since that information is stored per line. The statusline and message line are still printed into a buffer to be displayed by the window, but they are now positioned from the bottom of the screen.
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-16Ignore first keypress after entering insert modecflip
This fixes the problem where the key used to enter insert mode ('i' for example) would also be typed into the document.
2023-01-16Implement some more commands from vimcflip
2023-01-12Clean up editor_state's memory on teardowncflip
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-08Use C-style include guards instead of #pragma oncecflip
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/.