1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibGUI: Don't update selection twice after Ctrl-Right

This commit is contained in:
Ben Wiederhake 2021-10-12 20:40:38 +02:00 committed by Andreas Kling
parent 68884eefc6
commit 3647001c93
2 changed files with 3 additions and 7 deletions

View file

@ -79,7 +79,7 @@ bool EditingEngine::on_key(const KeyEvent& event)
}
if (event.ctrl()) {
m_editor->update_selection(event.shift());
move_to_next_span(event);
move_to_next_span();
if (event.shift() && m_editor->selection().start().is_valid()) {
m_editor->selection().set_end(m_editor->cursor());
m_editor->did_update_selection();
@ -217,7 +217,7 @@ void EditingEngine::move_to_previous_span()
m_editor->set_cursor(new_cursor);
}
void EditingEngine::move_to_next_span(const KeyEvent& event)
void EditingEngine::move_to_next_span()
{
TextPosition new_cursor;
if (m_editor->document().has_spans()) {
@ -232,10 +232,6 @@ void EditingEngine::move_to_next_span(const KeyEvent& event)
new_cursor = m_editor->document().first_word_break_after(m_editor->cursor());
}
m_editor->set_cursor(new_cursor);
if (event.shift() && m_editor->selection().start().is_valid()) {
m_editor->selection().set_end(m_editor->cursor());
m_editor->did_update_selection();
}
}
void EditingEngine::move_to_logical_line_beginning()