summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorIgor Ramazanov <igor.ramazanov@protonmail.com>2025-01-18 11:43:57 +0000
committerGitHub <noreply@github.com>2025-01-18 11:43:57 +0000
commitce4dc805e375dbd8c0477ad5005c2110f83de2aa (patch)
treeac2ca142a2182eb51ed64ffd029fa4111b4d8f48 /src/input_handler.hh
parentae9758e95f531d26847cfc7e884da3ceb47670f3 (diff)
parent54084900624493033cb24640d864c109cdac40a7 (diff)
Merge branch 'mawww:master' into contrib/gendocs.sh
Diffstat (limited to 'src/input_handler.hh')
-rw-r--r--src/input_handler.hh19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh
index ba73d2b1..32e9bfca 100644
--- a/src/input_handler.hh
+++ b/src/input_handler.hh
@@ -2,9 +2,10 @@
#define input_handler_hh_INCLUDED
#include "completion.hh"
-#include "constexpr_utils.hh"
+#include "array.hh"
#include "context.hh"
#include "env_vars.hh"
+#include "enum.hh"
#include "face.hh"
#include "normal.hh"
#include "optional.hh"
@@ -41,8 +42,7 @@ class InputMode;
enum class KeymapMode : char;
enum class CursorMode;
-using PromptCompleter = std::function<Completions (const Context&, CompletionFlags,
- StringView, ByteCount)>;
+using PromptCompleter = std::function<Completions (const Context&, StringView, ByteCount)>;
enum class InsertMode : unsigned
{
Insert,
@@ -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