Age | Commit message (Collapse) | Author |
|
Since this mode will also be used to accept input for setting the
filename, searching for a string and possibly more, it makes more sense
for this mode to be called prompt mode. There is also less ambiguity
between normal mode because sometimes that is also called command mode.
|
|
This first step allows you to press the semicolon key to enter command
mode, where you can type into a command line. Currently, pressing enter
when in command mode will clear the command line but since there are no
commands implemented it doesn't matter what you type in there.
|
|
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.
|
|
The editor now loads fonts from /usr/ instead of the current working
directory. Since they are gzipped the font loading code now uses zlib to
read from the files.
These fonts in particular were installed with `make install-psf` from
the Terminus makefile, however the location may vary from system to
system.
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
This fixes the problem where the key used to enter insert mode ('i' for
example) would also be typed into the document.
|
|
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.
|
|
|
|
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.
|