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

@ -37,6 +37,11 @@ enum CursorWidth {
WIDE
};
enum EditingEngineType {
Regular,
Vim
};
class EditingEngine {
AK_MAKE_NONCOPYABLE(EditingEngine);
AK_MAKE_NONMOVABLE(EditingEngine);
@ -51,11 +56,15 @@ public:
virtual bool on_key(const KeyEvent& event);
EditingEngineType type() const { return m_editing_engine_type; }
protected:
EditingEngine() { }
WeakPtr<TextEditor> m_editor;
EditingEngineType m_editing_engine_type;
void move_one_left(const KeyEvent& event);
void move_one_right(const KeyEvent& event);
void move_one_up(const KeyEvent& event);