mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 06:06:48 +00:00
LibLine: Implement internal functions to jump cursor over non-space word
Two new internal functions `cursor_left_nonspace_word()` (`Ctrl+Alt+B`) and `cursor_right_nonspace_word()` (`Ctrl+Alt+F`) that jump the cursor left or right until a non-space character. Same implementation as the alphanumeric word jump functions `cursor_left_word()` (`Alt+B`) and `cursor_right_word()` (`Alt+F`).
This commit is contained in:
parent
a6ce86a4b3
commit
97bcdba2a5
Notes:
sideshowbarker
2024-07-17 08:37:36 +09:00
Author: https://github.com/ronak69
Commit: 97bcdba2a5
Pull-request: https://github.com/SerenityOS/serenity/pull/22553
Reviewed-by: https://github.com/alimpfard
3 changed files with 39 additions and 0 deletions
|
@ -166,6 +166,8 @@ void Editor::set_default_keybinds()
|
|||
register_key_input_callback(Key { '.', Key::Alt }, EDITOR_INTERNAL_FUNCTION(insert_last_words));
|
||||
register_key_input_callback(Key { 'b', Key::Alt }, EDITOR_INTERNAL_FUNCTION(cursor_left_word));
|
||||
register_key_input_callback(Key { 'f', Key::Alt }, EDITOR_INTERNAL_FUNCTION(cursor_right_word));
|
||||
register_key_input_callback(Key { ctrl('B'), Key::Alt }, EDITOR_INTERNAL_FUNCTION(cursor_left_nonspace_word));
|
||||
register_key_input_callback(Key { ctrl('F'), Key::Alt }, EDITOR_INTERNAL_FUNCTION(cursor_right_nonspace_word));
|
||||
// ^[^H: alt-backspace: backward delete word
|
||||
register_key_input_callback(Key { '\b', Key::Alt }, EDITOR_INTERNAL_FUNCTION(erase_alnum_word_backwards));
|
||||
register_key_input_callback(Key { 'd', Key::Alt }, EDITOR_INTERNAL_FUNCTION(erase_alnum_word_forwards));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue