mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
VimEditingEngine: allow selection of the endline character
This patch fixes the visual selection of endline characters in the VimEditingEngine. When the visual mode is disabled and the cursor is located on the endline character, it is shifted back to the last character of the line.
This commit is contained in:
parent
0b47ea408c
commit
03d8ee1082
2 changed files with 34 additions and 10 deletions
|
@ -101,7 +101,7 @@ public:
|
|||
|
||||
void add_key_code(KeyCode key, bool ctrl, bool shift, bool alt);
|
||||
Optional<TextRange> get_range(class VimEditingEngine& engine, bool normalize_for_position = false);
|
||||
Optional<TextPosition> get_position(VimEditingEngine& engine);
|
||||
Optional<TextPosition> get_position(VimEditingEngine& engine, bool in_visual_mode = false);
|
||||
void reset();
|
||||
|
||||
/// Returns whether the motion should consume the next character no matter what.
|
||||
|
@ -168,7 +168,9 @@ private:
|
|||
void yank(TextRange);
|
||||
void put();
|
||||
|
||||
TextPosition m_selection_start_position = {};
|
||||
void update_selection_on_cursor_move();
|
||||
void clamp_cursor_position();
|
||||
void clear_visual_mode_data();
|
||||
|
||||
KeyCode m_previous_key {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue