Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This was causing the editor to crash on startup when opening a file from
the command line.
|
|
This code change and commit message were both written using the text
editor!
|
|
The previous rasterizing code relied on each row in the font being 8
bits wide, which is not the case with any font wider than 8 pixels.
These changes make it possible to properly load the 24px Terminus font,
and somehow also fixes incorrect characters in the 12px font.
|
|
Tabs don't show up in the text input event for whatever reason so they
need to be manually inserted.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
This binary file format is much easier to parse.
|
|
|
|
Now the text editor is visible in the window! There are still escape
codes for terminal output all over the place, but this is a good start.
|
|
|
|
|
|
There isn't much reason for the editor to run in a terminal window, so
the next step is to draw and get input events from a graphical window
using SDL.
This commit adds a basic test program that can read a font in the BDF
format and display text to the screen. This code will eventually be
integrated with the rest of the editor.
|
|
|
|
This is based off of snaptoken's "Build Your Own Text Editor" tutorial
at https://viewsourcecode.org/snaptoken/kilo/.
|