summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-07-22 17:43:37 +1000
committerMaxime Coste <mawww@kakoune.org>2024-07-22 20:22:14 +1000
commite938d724f16ef06cbc97a4fedc20d56edf34e7f2 (patch)
treebc5828353bdc26259b59bf6eadf8e7bb08b9f062 /src/input_handler.hh
parent6f562aa0add09092d390f7ea2691959490234ed0 (diff)
Handle word completion when recording macros
Make last insert and macro recording closer together, paving the way towards moving last insert to a register. Use a FunctionRef for insert completer key insertion support.
Diffstat (limited to 'src/input_handler.hh')
-rw-r--r--src/input_handler.hh13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh
index ba73d2b1..dd475c92 100644
--- a/src/input_handler.hh
+++ b/src/input_handler.hh
@@ -91,7 +91,7 @@ public:
Timer::Callback idle_callback = Timer::Callback{});
// process the given key
- void handle_key(Key key);
+ void handle_key(Key key, bool synthesized);
void refresh_ifn();
@@ -131,6 +131,9 @@ private:
void push_mode(InputMode* new_mode);
void pop_mode(InputMode* current_mode);
+ void record_key(Key key);
+ void drop_last_recorded_key();
+
struct Insertion{
NestedBool recording;
InsertMode mode;
@@ -139,11 +142,11 @@ private:
int count;
} m_last_insert = { {}, InsertMode::Insert, {}, false, 1 };
- char m_recording_reg = 0;
- String m_recorded_keys;
- int m_recording_level = -1;
+ int m_handle_key_level = 0;
- int m_handle_key_level = 0;
+ char m_recording_reg = 0;
+ Vector<Key> m_recorded_keys;
+ int m_recording_level = -1;
};
enum class AutoInfo