TextEditor: Add vim status indicators to the statusbar

When using the VimEditingEngine in the TextEditor, vim's mode and the
previous key are shown in the editor's statusbar.
This commit is contained in:
Zac 2021-01-27 15:49:29 +10:00 committed by Andreas Kling
commit bd6d0d2295
Notes: sideshowbarker 2024-07-18 22:38:32 +09:00
10 changed files with 171 additions and 20 deletions

View file

@ -150,6 +150,8 @@ public:
Function<void()> on_down_pressed;
Function<void()> on_pageup_pressed;
Function<void()> on_pagedown_pressed;
Function<void()> on_vim_statusbar_messages_changed;
Function<void()> on_editing_engine_changed;
Action& undo_action() { return *m_undo_action; }
Action& redo_action() { return *m_redo_action; }
@ -195,6 +197,9 @@ public:
void delete_text_range(TextRange);
String vim_mode_statusbar_message() const { return m_vim_mode_statusbar_message; }
String vim_previous_keys_statusbar_message() const { return m_vim_previous_keys_statusbar_message; }
protected:
explicit TextEditor(Type = Type::MultiLine);
@ -351,6 +356,9 @@ private:
Gfx::IntPoint m_last_mousemove_position;
RefPtr<Gfx::Bitmap> m_icon;
String m_vim_mode_statusbar_message {};
String m_vim_previous_keys_statusbar_message {};
};
}