7 Commits

Author SHA1 Message Date
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