mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
LibLine: Implement basic cut-and-paste functionality
Every cut operation (erase last word backward/forward, erase line till start/end) stores the erased characters in `m_last_erased` u32 vector. The last erased characters will get inserted into the buffer when `Ctrl+Y` (`insert_last_erased()` internal function) is pressed.
This commit is contained in:
parent
97bcdba2a5
commit
9d3604215d
Notes:
sideshowbarker
2024-07-17 03:00:02 +09:00
Author: https://github.com/ronak69
Commit: 9d3604215d
Pull-request: https://github.com/SerenityOS/serenity/pull/22553
Reviewed-by: https://github.com/alimpfard
3 changed files with 49 additions and 2 deletions
|
@ -164,6 +164,7 @@ void Editor::set_default_keybinds()
|
|||
|
||||
// ^[.: alt-.: insert last arg of previous command (similar to `!$`)
|
||||
register_key_input_callback(Key { '.', Key::Alt }, EDITOR_INTERNAL_FUNCTION(insert_last_words));
|
||||
register_key_input_callback(ctrl('Y'), EDITOR_INTERNAL_FUNCTION(insert_last_erased));
|
||||
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue