home/src
Johannes Altmanninger 12310418b0 Allow map/unmap during mapping execution
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-07-20 09:18:23 +02:00
..
.gdbinit Embed gdb pretty-printing script directly into Kakoune binary 2019-01-23 20:27:16 +11:00
alias_registry.cc Rename containers.hh to ranges.hh (and Container to Range) 2017-08-29 15:23:03 +07:00
alias_registry.hh Make FaceRegistry scoped 2018-04-07 16:27:50 +10:00
array_view.hh Replace std::enable_if with requires 2021-11-21 09:44:56 +11:00
assert.cc Escape message before running xmessage in a shell 2022-06-26 18:07:22 +02:00
assert.hh Add support for the shift modifier. 2018-04-11 15:15:45 +10:00
backtrace.cc Apply clang-tidy modernize to the codebase 2017-01-08 22:39:01 +00:00
backtrace.hh Return a String in Backtrace::desc 2015-05-29 13:35:54 +01:00
buffer_manager.cc Support opening files bigger than 2 GiB 2021-05-28 17:03:41 +10:00
buffer_manager.hh Remove unnecessary forward declaration 2021-07-20 22:30:41 +10:00
buffer_utils.cc Revert "Switch undo storage from a tree to a plain list" 2023-06-17 17:31:57 +10:00
buffer_utils.hh rework selection insert/replace using a for_each method 2021-09-30 20:12:58 +10:00
buffer.cc Another small structured binding conversion 2023-06-21 17:36:33 +10:00
buffer.hh Revert "Switch undo storage from a tree to a plain list" 2023-06-17 17:31:57 +10:00
buffer.inl.hh Replace std::strong_ordering with auto return type to not require <compare> 2023-01-21 11:19:39 +11:00
changes.cc Fix overly strict backward_sorted_until 2017-02-20 19:46:12 +00:00
changes.hh Fix pasting after when selections are overlapping 2022-11-28 20:27:44 +11:00
client_manager.cc Fix regression when file on command line cannot be opened 2023-01-08 17:26:15 +01:00
client_manager.hh Load buffer in command line order 2022-12-06 17:48:42 +11:00
client.cc Add <c-g> to cancel current operation 2023-05-21 16:20:51 +10:00
client.hh Allow to undo and redo selection changes 2022-09-02 02:59:47 +02:00
clock.hh Remove DurationMs and slight code refactor 2018-12-28 06:27:35 +11:00
color.cc Make Color::validate_alpha() a constexpr function. 2022-02-12 21:35:33 +11:00
color.hh Make Color::validate_alpha() a constexpr function. 2022-02-12 21:35:33 +11:00
command_manager.cc Add support for recursive expansions with %exp{...} 2023-05-04 12:49:50 +10:00
command_manager.hh Add support for recursive expansions with %exp{...} 2023-05-04 12:49:50 +10:00
commands.cc Allow map/unmap during mapping execution 2023-07-20 09:18:23 +02:00
commands.hh Re-introduce kill_session::exit_status, @lenormf was right 2018-07-19 19:27:56 +10:00
completion.cc Do not expose C++ typeid().name to user facing errors on wrong option type 2018-05-26 10:01:26 +10:00
completion.hh Restore auto-select on return, add a flag to disable that for commands 2020-11-18 19:56:05 +11:00
constexpr_utils.hh Fix compilation due to failing template deduction for aggregates 2022-04-28 19:34:36 +02:00
context.cc Make selection undo skip over entries that are nop after buffer change 2022-12-27 18:24:55 +01:00
context.hh Rename "disable_history" stack state to "noninteractive" 2023-06-17 11:21:16 +02:00
coord.hh Fix warnings with gcc-13 2023-05-21 12:40:27 +10:00
diff.hh Remove posB from information given by the diff algorithm 2020-03-20 20:27:50 +11:00
display_buffer.cc Trim display lines before the colorize pass 2023-06-12 16:26:22 +10:00
display_buffer.hh Merge remote-tracking branch 'arrufat/fix-build-gcc13' 2023-06-12 21:53:39 +10:00
enum.hh Replace std::enable_if with requires 2021-11-21 09:44:56 +11:00
env_vars.cc Do not copy environment strings, just refer to them 2019-03-21 20:43:24 +11:00
env_vars.hh Replace IdMap with HashMap 2017-03-07 01:12:37 +00:00
event_manager.cc Add <c-g> to cancel current operation 2023-05-21 16:20:51 +10:00
event_manager.hh Add <c-g> to cancel current operation 2023-05-21 16:20:51 +10:00
exception.cc exception::what returns a StringView rather than a const char* 2015-03-13 13:15:51 +00:00
exception.hh Add <c-g> to cancel current operation 2023-05-21 16:20:51 +10:00
face_registry.cc Pre-parse face specs in Highlighters 2023-06-10 09:46:46 +10:00
face_registry.hh Pre-parse face specs in Highlighters 2023-06-10 09:46:46 +10:00
face.hh Re-work line trimming to fix issues with column highighters 2022-07-13 12:24:14 +10:00
file.cc Fix crash after multiple terminal resizes 2023-04-24 18:31:05 +02:00
file.hh Fix crash after multiple terminal resizes 2023-04-24 18:31:05 +02:00
flags.hh Replace std::enable_if with requires 2021-11-21 09:44:56 +11:00
hash_map.cc Fix clang warning regarding useless braces when using HashSet 2022-08-28 15:23:29 +02:00
hash_map.hh Refactor KeymapManager to enfore setting is_executing on key iteration 2023-05-29 20:11:06 +10:00
hash.cc Merge branch 'roam-murmurhash-endian' of http://github.com/ppentchev/kakoune 2022-07-10 17:46:07 +10:00
hash.hh Replace std::enable_if with requires 2021-11-21 09:44:56 +11:00
highlighter_group.cc Use menu behavior for add-highlighter/remove-highlighter completion 2022-07-21 16:48:44 +02:00
highlighter_group.hh Rename DefinedHighlighters to SharedHighlighters 2020-08-08 11:19:02 +10:00
highlighter.cc Add -override support to add-highlighter 2020-03-30 21:04:01 +11:00
highlighter.hh Refactor highlighting logic 2022-07-10 14:58:24 +10:00
highlighters.cc Fix invalid access of display line end 2023-06-20 13:09:03 +10:00
highlighters.hh Use inplace_merge() for ranges 2021-03-09 10:13:31 -05:00
hook_manager.cc Rename "disable_history" stack state to "noninteractive" 2023-06-17 11:21:16 +02:00
hook_manager.hh Immediately execute ModuleLoaded hooks for already loaded modules 2023-02-14 21:31:29 +11:00
input_handler.cc Refactor prompt history handling 2023-07-05 22:00:32 +10:00
input_handler.hh Disable history only for prompts that are never shown in the UI 2023-06-17 11:21:41 +02:00
insert_completer.cc This commit attempts to fix a crash with -f. Specifically when kakoune 2022-12-21 17:46:49 -05:00
insert_completer.hh Code style cleanups around insert completer 2022-06-04 10:50:09 +10:00
json_ui.cc Implement bracketed paste 2023-03-11 16:21:57 +01:00
json_ui.hh Implement bracketed paste 2023-03-11 16:21:57 +01:00
json.cc Fix spurious warning likely due to String::Data not being std compliant 2021-12-11 08:44:19 +11:00
json.hh src: Move JSON parsing code to its own file 2019-11-17 09:27:46 +01:00
keymap_manager.cc Allow map/unmap during mapping execution 2023-07-20 09:18:23 +02:00
keymap_manager.hh Allow map/unmap during mapping execution 2023-07-20 09:18:23 +02:00
keys.cc Fix debug keys output for shift/ctrl modified mouse events 2023-05-11 20:21:31 +01:00
keys.hh Fix new gcc errors for missing types. 2023-02-28 19:36:44 -08:00
line_modification.cc Avoid potentially quadratic runtime when updating selections after modification 2022-09-17 06:44:57 -05:00
line_modification.hh Introduce FunctionRef to replace std::function when not storing 2019-09-01 13:04:47 +10:00
main.cc Merge remote-tracking branch 'omasanori/fixup-undo-doc' 2023-07-03 20:14:21 +10:00
Makefile make clean: also clean up generated version files 2022-05-29 10:31:59 +02:00
memory.cc Track more memory statistics 2019-03-21 20:35:22 +11:00
memory.hh Remove unused History MemoryDomain 2022-10-19 20:16:09 +11:00
meta.hh Use BufferCoord sentinel type for regex matching on BufferIterators 2018-11-01 21:51:10 +11:00
normal.cc Refactor prompt history handling 2023-07-05 22:00:32 +10:00
normal.hh Make linewise bracketed paste match P behavior 2023-03-11 16:21:57 +01:00
option_manager.cc Defer deletion of unsetted option to return to main loop 2019-01-20 22:46:40 +11:00
option_manager.hh Add support for removing from options 2020-09-09 21:00:30 +10:00
option_types.cc Use std::remove_cvref instead of std::decay 2021-11-21 09:44:57 +11:00
option_types.hh Replace std::enable_if with requires 2021-11-21 09:44:56 +11:00
option.hh Add support for removing from options 2020-09-09 21:00:30 +10:00
optional.hh Remove && from the template parameter given to declval 2023-03-15 12:34:12 +05:30
parameters_parser.cc Complete arguments to "echo -to-file" 2023-02-17 20:50:58 +01:00
parameters_parser.hh Complete arguments to "echo -to-file" 2023-02-17 20:50:58 +01:00
range.hh Refactor how InsetCompletionHide hook parameter is computed 2020-06-27 13:33:50 +10:00
ranges.cc Fix compilation due to failing template deduction for aggregates 2022-04-28 19:34:36 +02:00
ranges.hh Fix compilation failure with clang 12 and debug=yes 2022-10-02 14:04:07 +02:00
ranked_match.cc Accept "cd dir/" again instead of using a subdirectory 2022-11-19 15:20:31 +01:00
ranked_match.hh Fix new gcc errors for missing types. 2023-02-28 19:36:44 -08:00
ref_ptr.hh Fix crash when deleting a buffer from a user mapping 2022-04-12 12:49:19 +10:00
regex_impl.cc Unbreak build on ppc 2023-06-27 12:29:45 +08:00
regex_impl.hh Unbreak build on ppc 2023-06-27 12:29:45 +08:00
regex.cc Try to bypass clang crash 2019-01-20 22:59:28 +11:00
regex.hh Add an idle callback to be called regularly while regex matching 2023-05-21 16:20:51 +10:00
register_manager.cc Elide temporary vector when completing register names 2022-07-21 16:48:44 +02:00
register_manager.hh Remove stale comment about StaticRegister 2022-08-16 19:15:22 +02:00
remote.cc Implement bracketed paste 2023-03-11 16:21:57 +01:00
remote.hh Rework session directory logic 2021-05-01 15:29:50 +10:00
safe_ptr.hh Header and dependency cleanup 2019-01-24 21:22:20 +11:00
scope.cc Do not include non-primitive option value in *SetOption hook filter 2020-06-09 21:38:47 +10:00
scope.hh Add override 2019-11-09 12:53:45 -05:00
selection.cc Fix pasting after when selections are overlapping 2022-11-28 20:27:44 +11:00
selection.hh Fix pasting after when selections are overlapping 2022-11-28 20:27:44 +11:00
selectors.cc Add <c-g> to cancel current operation 2023-05-21 16:20:51 +10:00
selectors.hh Ensure that the capture group actually matched in select_matches 2020-09-22 21:14:40 +10:00
shared_string.cc Avoid calling memcpy from empty string views 2022-08-21 17:52:51 +02:00
shared_string.hh src: Fix undefined behaviour 2021-10-23 10:36:37 +02:00
shell_manager.cc Kill current shell on <c-g> during shell execution 2023-05-29 20:25:56 +10:00
shell_manager.hh Expand env vars as list of strings 2020-03-02 20:53:28 +11:00
string_utils.cc Support adding ByteCount to void/char pointers without casting 2022-12-15 13:29:45 +11:00
string_utils.hh Add support for field width and digit grouping in format 2022-08-20 11:03:03 +02:00
string.cc Improve code-generation for Strings 2021-07-20 22:30:41 +10:00
string.hh Support adding ByteCount to void/char pointers without casting 2022-12-15 13:29:45 +11:00
terminal_ui.cc Remove unneeded this capture in lambda 2023-06-09 21:47:49 +09:00
terminal_ui.hh Implement bracketed paste 2023-03-11 16:21:57 +01:00
unicode.hh Follow ECMA specification for regex whitespace 2021-02-25 11:03:18 -05:00
unit_tests.cc Remove posB from information given by the diff algorithm 2020-03-20 20:27:50 +11:00
unit_tests.hh Small refactor in unit tests 2015-05-24 22:34:05 +01:00
units.hh Revert "Remove compare include that seems to break clang" 2023-01-21 11:27:05 +11:00
user_interface.hh Implement bracketed paste 2023-03-11 16:21:57 +01:00
utf8_iterator.hh Convert comparisons to spaceship operator 2021-11-21 09:44:56 +11:00
utf8.hh Rank a word-boundary after a non-word-boundary 2019-09-07 22:53:29 +02:00
utils.hh Clang is still unhappy, trying another approach with defining my own concept 2021-11-25 22:32:10 +11:00
value.hh Avoid extra indirection for storing FifoWatcher 2023-02-10 12:56:32 +11:00
vector.hh Only redraw updated lines 2021-07-12 10:25:58 +10:00
window.cc Trim display lines before the colorize pass 2023-06-12 16:26:22 +10:00
window.hh Fix window_range expansion 2019-12-16 14:09:20 +11:00
word_db.cc Support opening files bigger than 2 GiB 2021-05-28 17:03:41 +10:00
word_db.hh Fix performance issue with word completion 2020-11-07 10:42:51 +11:00