1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:38:13 +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:
sin-ack 2021-04-26 20:29:05 +00:00 committed by Andreas Kling
parent 4e6a26cbd2
commit d6dc81874d
6 changed files with 72 additions and 68 deletions

View file

@ -178,7 +178,7 @@ public:
void add_code_point(u32 code_point);
void reset_cursor_blink();
void toggle_selection_if_needed_for_event(bool is_selecting);
void update_selection(bool is_selecting);
int number_of_visible_lines() const;
Gfx::IntRect cursor_content_rect() const;