summaryrefslogtreecommitdiff
path: root/src/keymap_manager.cc
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.cc
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.cc')
-rw-r--r--src/keymap_manager.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keymap_manager.cc b/src/keymap_manager.cc
index 582a271d..baec1373 100644
--- a/src/keymap_manager.cc
+++ b/src/keymap_manager.cc
@@ -40,8 +40,8 @@ bool KeymapManager::is_mapped(Key key, KeymapMode mode) const
(m_parent and m_parent->is_mapped(key, mode));
}
-const KeymapManager::KeymapInfo&
-KeymapManager::get_mapping(Key key, KeymapMode mode) const
+KeymapManager::KeymapInfo&
+KeymapManager::get_mapping(Key key, KeymapMode mode)
{
auto it = m_mapping.find(KeyAndMode{key, mode});
if (it != m_mapping.end())