diff options
| author | Maxime Coste <mawww@kakoune.org> | 2023-05-29 20:08:02 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2023-05-29 20:11:06 +1000 |
| commit | cf7c6380254c7c2733952d2899761a2afc881b44 (patch) | |
| tree | 7e1dd924a2c37fb34063ae7d3e9e2668f036ec2a /src/normal.cc | |
| parent | 3069b68245a0bd5451fac33a56097eb7c9351975 (diff) | |
Refactor KeymapManager to enfore setting is_executing on key iteration
Add an iterator based remove to HashMap as that was missing. Make
KeymapManager responsible for throwing on unmap an executing mapping.
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc index 87bf272a..68392199 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -191,7 +191,7 @@ String build_autoinfo_for_mapping(const Context& context, KeymapMode mode, for (auto& key : keymaps.get_mapped_keys(mode)) descs.emplace_back(to_string(key), - keymaps.get_mapping(key, mode).docstring); + keymaps.get_mapping_docstring(key, mode)); auto max_len = 0_col; for (auto& desc : descs) @@ -2025,7 +2025,6 @@ void exec_user_mappings(Context& context, NormalParams params) if (not context.keymaps().is_mapped(key, KeymapMode::User)) return; - auto& mapping = context.keymaps().get_mapping(key, KeymapMode::User); ScopedSetBool disable_keymaps(context.keymaps_disabled()); ScopedSetBool disable_history(context.history_disabled()); @@ -2033,8 +2032,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) + for (auto& key : context.keymaps().get_mapping_keys(key, KeymapMode::User)) context.input_handler().handle_key(key); }, "user mapping", build_autoinfo_for_mapping(context, KeymapMode::User, {})); |
