VimEditingEngine: Add J command to join two lines
This commit is contained in:
parent
a7e7f62d08
commit
180e2469af
Notes:
sideshowbarker
2024-07-18 08:59:28 +09:00
Author: https://github.com/mattyhall Commit: https://github.com/SerenityOS/serenity/commit/180e2469aff Pull-request: https://github.com/SerenityOS/serenity/pull/8622
1 changed files with 10 additions and 0 deletions
|
@ -916,6 +916,16 @@ bool VimEditingEngine::on_key_in_normal_mode(const KeyEvent& event)
|
|||
case (KeyCode::Key_RightBrace):
|
||||
move_to_next_empty_lines_block();
|
||||
return true;
|
||||
case (KeyCode::Key_J): {
|
||||
if (m_editor->cursor().line() + 1 >= m_editor->line_count())
|
||||
return true;
|
||||
move_to_logical_line_end();
|
||||
m_editor->add_code_point(' ');
|
||||
TextPosition next_line = { m_editor->cursor().line() + 1, 0 };
|
||||
m_editor->delete_text_range({ m_editor->cursor(), next_line });
|
||||
move_one_left();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue