mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 14:32:18 +00:00
LibGUI: Delete from current position to end of line in VimEditingEngine
When in normal mode pressing Shift+D will delete from the current cursor position to the end of the line. Leaving the cursor on the character before where the cursor was when the deletion took place.
This commit is contained in:
parent
166a905951
commit
6926991a56
Notes:
sideshowbarker
2024-07-17 08:34:29 +09:00
Author: https://github.com/huttongrabiel
Commit: 6926991a56
Pull-request: https://github.com/SerenityOS/serenity/pull/15509
Reviewed-by: https://github.com/ADKaster
1 changed files with 5 additions and 0 deletions
|
@ -963,6 +963,11 @@ bool VimEditingEngine::on_key_in_normal_mode(KeyEvent const& event)
|
|||
move_to_logical_line_end();
|
||||
switch_to_insert_mode();
|
||||
return true;
|
||||
case (KeyCode::Key_D):
|
||||
m_editor->delete_text_range({ m_editor->cursor(), { m_editor->cursor().line(), m_editor->current_line().length() } });
|
||||
if (m_editor->cursor().column() != 0)
|
||||
move_one_left();
|
||||
break;
|
||||
case (KeyCode::Key_I):
|
||||
move_to_logical_line_beginning();
|
||||
switch_to_insert_mode();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue