LibGUI: Add Ctrl-W to insert mode

In Vim's insert mode, Ctrl-W deletes the word before the cursor, like
Ctrl-Backspace. Unlike Ctrl-Backspace, if only whitespace exists between
the end of the word and the cursor, the word will be deleted with the
whitespace.

To do so, this commit introduces two methods: delete_previous_word() for
TextEditor and first_word_before() for TextDocument, where the former
depends on the latter. delete_previous_word() is then called in
VimEditingEngine.
This commit is contained in:
Ariel Don 2021-07-13 22:12:07 -05:00 committed by Gunnar Beutner
commit 808e5e813f
Notes: sideshowbarker 2024-07-18 08:42:23 +09:00
5 changed files with 52 additions and 0 deletions

View file

@ -135,6 +135,7 @@ public:
void paste();
void do_delete();
void delete_current_line();
void delete_previous_word();
void select_all();
virtual void undo();
virtual void redo();