From e49c0fb04095a2a1c546fd033ce2a1a6df3eb8d0 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 14 May 2023 12:59:18 +0200 Subject: 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 --- src/normal.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index f1123ca7..87bf272a 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -2033,6 +2033,7 @@ void exec_user_mappings(Context& context, NormalParams params) ScopedEdition edition(context); ScopedSelectionEdition selection_edition{context}; + ScopedSetBool executing_mapping{mapping.is_executing}; for (auto& key : mapping.keys) context.input_handler().handle_key(key); }, "user mapping", -- cgit v1.2.3