summaryrefslogtreecommitdiff
path: root/src/keymap_manager.hh
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2023-05-14 12:59:18 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2023-05-25 00:04:23 +0200
commite49c0fb04095a2a1c546fd033ce2a1a6df3eb8d0 (patch)
tree2c3a229a467aaf9b8d4f864186938c85cd3d0914 /src/keymap_manager.hh
parentcfa658b899b44a8a0f4c7f3dd9811ae0d44ddd3a (diff)
unmap: fail if the mapping is currently executing
When unmapping a key sequence that is currently executing, we continue executing freed memory which can have weird effects. Let's instead throw an error if that happens. In future we can support unmap in this scenario. Closes #4896
Diffstat (limited to 'src/keymap_manager.hh')
-rw-r--r--src/keymap_manager.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keymap_manager.hh b/src/keymap_manager.hh
index 7474ed95..ddb374e4 100644
--- a/src/keymap_manager.hh
+++ b/src/keymap_manager.hh
@@ -6,6 +6,7 @@
#include "hash.hh"
#include "string.hh"
#include "hash_map.hh"
+#include "utils.hh"
#include "vector.hh"
namespace Kakoune
@@ -42,8 +43,9 @@ public:
{
KeyList keys;
String docstring;
+ NestedBool is_executing{};
};
- const KeymapInfo& get_mapping(Key key, KeymapMode mode) const;
+ KeymapInfo& get_mapping(Key key, KeymapMode mode);
using UserModeList = Vector<String>;
UserModeList& user_modes() {