mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
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:
parent
e11ec20650
commit
bd6d0d2295
10 changed files with 171 additions and 20 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue