mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
EditingEngine: Split selection from movement functions
This patch moves selection updates outside movement functions in EditingEngine. Previously, movement functions would automatically update the selection based on whether the Shift key was pressed down during movement. However, not all EditingEngine subclasses want that; VimEditingEngine being a good example (because all selection is handled in visual mode). Therefore, this patch moves all selection updating to EditingEngine::on_key(). Subclasses wishing to provide custom movement and selection semantics should override it (and VimEditingEngine already does).
This commit is contained in:
parent
4e6a26cbd2
commit
d6dc81874d
6 changed files with 72 additions and 68 deletions
|
@ -920,7 +920,7 @@ void TextEditor::reset_cursor_blink()
|
|||
start_timer(500);
|
||||
}
|
||||
|
||||
void TextEditor::toggle_selection_if_needed_for_event(bool is_selecting)
|
||||
void TextEditor::update_selection(bool is_selecting)
|
||||
{
|
||||
if (is_selecting && !selection()->is_valid()) {
|
||||
selection()->set(cursor(), {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue