diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc index 8cd81a80..76f53f67 100644 --- a/doc/pages/changelog.asciidoc +++ b/doc/pages/changelog.asciidoc @@ -18,6 +18,8 @@ released versions. * History registers `%reg{colon}`, `%reg{slash}` and `%reg{pipe}` now have reverse chronological order +* Executing user mode mappings no longer adds to prompt history registers by default. + == Kakoune 2021.11.07 * Support for curly and separately colored underlines (undocumented in 2021.10.28) diff --git a/doc/pages/mapping.asciidoc b/doc/pages/mapping.asciidoc index c029383b..019a6bcf 100644 --- a/doc/pages/mapping.asciidoc +++ b/doc/pages/mapping.asciidoc @@ -59,13 +59,9 @@ It's common to use a normal-mode or user-mode mapping to trigger a command, like this: ---- -map global user n ': make-next-error' +map global user n :make-next-error ---- -Note the space between the `:` and the command. This prevents Kakoune from -adding this command to the prompt history, so the user won't have to scroll -past it to review commands they actually typed. - If you make a normal-mode mapping, you can prefix it with a count or a register name like any other normal-mode key. You can forward this information to the command you invoke with the `%val{count}` and `%val{register}` expansions diff --git a/src/commands.cc b/src/commands.cc index f07c768b..d9f2500a 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -2620,6 +2620,7 @@ void enter_user_mode(Context& context, String mode_name, KeymapMode mode, bool l auto& mapping = context.keymaps().get_mapping(key, mode); ScopedSetBool disable_keymaps(context.keymaps_disabled()); + ScopedSetBool disable_history(context.history_disabled()); InputHandler::ScopedForceNormal force_normal{context.input_handler(), {}}; diff --git a/src/normal.cc b/src/normal.cc index 09aad6f8..68a5fd6f 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -2014,6 +2014,7 @@ void exec_user_mappings(Context& context, NormalParams params) auto& mapping = context.keymaps().get_mapping(key, KeymapMode::User); ScopedSetBool disable_keymaps(context.keymaps_disabled()); + ScopedSetBool disable_history(context.history_disabled()); InputHandler::ScopedForceNormal force_normal{context.input_handler(), params};