1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:27:45 +00:00

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
parent 8f01a8b741
commit 808e5e813f
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();