diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-18 18:28:15 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-18 18:28:15 -0500 |
commit | ba559cc360162e02cfc79885637c9247bcecc0d8 (patch) | |
tree | a2b178e82ab0a5eeee11f543cd0c9b9fe104c97a /main.c | |
parent | 4e2c4c4a6c501602b4f42cb7c748bd5c8f02b8b6 (diff) |
ctrl+backspace/delete
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -130,10 +130,16 @@ int main(void) { buffer_insert_char_at_cursor(&text_buffer, U'\t'); break; case SDLK_DELETE: - buffer_delete_chars_at_cursor(&text_buffer, 1); + if (ctrl) + buffer_delete_words_at_cursor(&text_buffer, 1); + else + buffer_delete_chars_at_cursor(&text_buffer, 1); break; case SDLK_BACKSPACE: - buffer_backspace(&text_buffer, 1); + if (ctrl) + buffer_backspace_words_at_cursor(&text_buffer, 1); + else + buffer_backspace_at_cursor(&text_buffer, 1); break; } } break; |