summaryrefslogtreecommitdiff
path: root/src/commands.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2025-03-22 14:37:53 +1100
committerMaxime Coste <mawww@kakoune.org>2025-03-22 14:37:53 +1100
commit2b37548b5e8839dd22dc5ac21196e0e5d835a3d1 (patch)
tree63654e2a7a36511af6a24564f266f48711944d84 /src/commands.cc
parentda5e5bc635fa6a3def21d3d59906b9ee0f1d1831 (diff)
parent302001d84b1c1f72662883c4dee0e64846843de8 (diff)
Merge remote-tracking branch 'lenormf/fix-user-mode-lock'
Diffstat (limited to 'src/commands.cc')
-rw-r--r--src/commands.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/commands.cc b/src/commands.cc
index ddc94c3b..c9e68060 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -2686,18 +2686,18 @@ void enter_user_mode(Context& context, String mode_name, KeymapMode mode, bool l
[mode_name, mode, lock](Key key, Context& context) mutable {
if (key == Key::Escape)
return;
- if (not context.keymaps().is_mapped(key, mode))
- return;
-
- ScopedSetBool disable_keymaps(context.keymaps_disabled());
- ScopedSetBool noninteractive(context.noninteractive());
- InputHandler::ScopedForceNormal force_normal{context.input_handler(), {}};
+ if (context.keymaps().is_mapped(key, mode))
+ {
+ ScopedSetBool disable_keymaps(context.keymaps_disabled());
+ ScopedSetBool noninteractive(context.noninteractive());
- ScopedEdition edition(context);
+ InputHandler::ScopedForceNormal force_normal{context.input_handler(), {}};
- for (auto& key : context.keymaps().get_mapping_keys(key, mode))
- context.input_handler().handle_key(key, true);
+ ScopedEdition edition(context);
+ for (auto& key : context.keymaps().get_mapping_keys(key, mode))
+ context.input_handler().handle_key(key, true);
+ }
if (lock)
enter_user_mode(context, std::move(mode_name), mode, true);