11 Commits

Author SHA1 Message Date
0d69d9ea57 editor: add nec/nec_bold fonts
This also adds a new "viewport" bit-field, which will be initially be
used for incremental search data.

Several redundant range checks were removed.
2023-06-11 15:08:17 +00:00
8dd460f48f editor: add 'line_kill'
This also adds nullptr checking to decref--it seemed the functions
needing nullptr checks immediately prior to the decref call was
beginning to exceed the functions that had "implied" nullptr checking
as a part of their natural flow-control.
2023-06-11 04:26:49 +00:00
feb57872e8 editor: add delete_word_forward/backward
This also fixes a small ordering bug in selection_delete.
2023-06-11 03:58:17 +00:00
46c274d490 editor: add cursor_scan_word_forward/backward
'backward' feels very mildly hacky, but not in a terrible way.
2023-06-11 03:19:15 +00:00
5944e3a360 editor: add 'delete_forward' and 'delete' key-binding
This also renames 'backspace' to 'delete_backward' for consistency.
2023-06-11 01:27:42 +00:00
3803e501eb editor: standardize struct cursor vs editor::cursor 2023-06-11 01:02:53 +00:00
9e94718087 editor: set normal mode in copy
Previously there was no visual confirmation of a copy occuring.
2023-06-10 23:10:02 +00:00
a11dadcde8 editor: finish implementing shadow_paste
This adds a new overwrite_line is very useful for dealing with
cow-related boilerplate.

There is some refactoring possible (and perhaps accidental correctness
improvement) if more functions used 'overwrite_line'.
2023-06-10 23:01:13 +00:00
6a5ebab01f editor: add shadow-lines and region-deletes
This implements the "copy" portion of copy-and-paste and the "delete"
portion of cut-and-paste.

'backspace' was also partially refactored to share code with the new
'selection_delete'.

I am excited in how expressiveness/readability improved in 'backspace'
after selection_delete was implemented.
2023-06-10 02:57:54 +00:00
d313bdd855 editor: fix off-by-one error
This fixes multiple comparisons between the buffer length and the
cursor row.

Also refactor the key-binding logic for better flexibility.
2023-06-09 00:59:19 +00:00
c86fcbd6af editor: add example
This adds a simple text editor with basic visual line-editing
capabilities.
2023-06-08 22:50:07 +00:00