summaryrefslogtreecommitdiff
path: root/src/keymap_manager.hh
AgeCommit message (Collapse)Author
2024-08-16include headers cleanupAdrià Arrufat
2024-04-12Introduce "local" scope in evaluate-commandsMaxime Coste
When using `eval` a new scope named 'local' gets pushed for the whole evaluation, this makes it possible to temporarily set an option/hook/alias... Local scopes nest so nested evals do work as expected. Remove the now trivial with-option command
2023-07-20Allow map/unmap during mapping executionJohannes Altmanninger
Commits e49c0fb04 (unmap: fail if the mapping is currently executing, 2023-05-14) 42be0057a (map: fail if key is currently executing, 2023-06-24) fixed potential use-after-free issues. By doing so, it broke configurations that in practice have not triggered any crashes [1] [2]. For example with, set -remove global autocomplete insert hook global InsertCompletionShow .* %{ map window insert <esc> <c-o> } hook global InsertCompletionHide .* %{ unmap window insert <esc> <c-o> } The execution of the <esc> mapping triggers InsertCompletionHide fails at unmapping. This seems legit and I don't see an obvious alternative way to write it (InsertIdle would not be correct though it would work in practice). Fix the regression by allowing map and unmap again while keeping the mappings alive until they have finished executing. Applying map/unmap immediately seems like the most obvious semantics. Alternatively, we could apply them in between key presses. [1]: <https://github.com/kak-lsp/kak-lsp/issues/689> [2]: <https://github.com/alexherbo2/auto-pairs.kak/issues/60>
2023-05-29Refactor KeymapManager to enfore setting is_executing on key iterationMaxime Coste
Add an iterator based remove to HashMap as that was missing. Make KeymapManager responsible for throwing on unmap an executing mapping.
2023-05-25unmap: fail if the mapping is currently executingJohannes Altmanninger
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
2021-10-23src: Fix the API of `KeymapManager::add_user_mode()`Frank LENORMAND
Cppcheck produces the following warning: ``` keymap_manager.hh:54:37: performance: Function parameter 'user_mode_name' should be passed by const reference. ``` Fixes #4340
2018-09-23Add a way to unmap all keys of a given mode at onceDelapouite
2018-03-02Remove <scope> from user-modes commandsDelapouite
2018-02-12Add declare-user-mode / enter-user-mode commandsDelapouite
2017-11-24Rename KeyMapInfo → KeymapInfoDelapouite
2017-03-07Replace uses of UnorderedMap with HashMapMaxime Coste
2017-03-03Add docstring support for mappings, and use them in autoinfoMaxime Coste
Fixes #105 Fixes #1100 Closes #1165
2015-07-01Add remapping of text object keysViktor Palmkvist
2015-04-11Use char for KeyMapMode enumMaxime Coste
2015-03-09ArrayView content is not const anymoreMaxime Coste
As in upcoming std c++ array_view, ArrayView<T> points to mutable data, use ArrayView<const T> or alias ConstArrayView<T> for const data.
2015-01-12Yet more trackingMaxime Coste
2015-01-06Rename memoryview to ArrayViewMaxime Coste
2014-12-23Remove trailing blank linesMaxime Coste
2014-12-17Tweak keymap_manager style, fix missing moveMaxime Coste
2014-12-16Rework hashing, use a more extensible framework similar to n3876 proposalMaxime Coste
std::hash specialization is a pain to work with, stop using that, and just specialize a 'size_t hash_value(const T&)' free function.
2014-12-12Add support for user mappings, bound to commaMaxime Coste
:map have a 'user' mode that is accessible through the comma key. the mapping will get executed in normal mode.
2014-11-12Cleanup includesMaxime Coste
2014-10-30Add scope class and encapsulate Options, Keymaps, Aliases and Hooks in itMaxime Coste
2014-09-23Add support for mapping keys in goto/view commandsMaxime Coste
2014-05-04minor style tweakMaxime Coste
2013-11-18rename idvaluemap to id_map, remove Id template param, use StringMaxime Coste
2013-11-18Resurect idvaluemap, order of traversal mattersMaxime Coste
This reverts commit 2b9b161d424c1168636042adc6678bb3df2be3f9.
2013-11-17remove idvaluemap, use unordered_map in placeMaxime Coste
2013-10-25Add key mapping supportMaxime Coste