summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2022-08-03 20:37:44 +1000
committerMaxime Coste <mawww@kakoune.org>2022-08-03 20:37:44 +1000
commit31e9fc3cefcbea03d4eaad75ed0dab3da8f3dc6f (patch)
tree30cc92b8d541a3c750fc522c808b7a0ece99e63a
parentfa209a9a97c652dffd2986e5e97b55b5dc4826a2 (diff)
parent395f43837898a1a1ac19755e479ad6aa1a574c25 (diff)
Merge remote-tracking branch 'krobelus/history-in-mappings'
-rw-r--r--doc/pages/changelog.asciidoc2
-rw-r--r--doc/pages/mapping.asciidoc8
-rw-r--r--rc/filetype/diff.kak2
-rw-r--r--rc/filetype/mail.kak4
-rw-r--r--rc/tools/doc.kak2
-rw-r--r--rc/tools/git.kak4
-rw-r--r--rc/tools/man.kak10
-rw-r--r--src/commands.cc1
-rw-r--r--src/normal.cc1
9 files changed, 17 insertions, 17 deletions
diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc
index d475f278..5d2cfa2e 100644
--- a/doc/pages/changelog.asciidoc
+++ b/doc/pages/changelog.asciidoc
@@ -18,6 +18,8 @@ released versions.
* Prompt 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..0ba142c4 100644
--- a/doc/pages/mapping.asciidoc
+++ b/doc/pages/mapping.asciidoc
@@ -59,20 +59,16 @@ 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<ret>'
+map global user n :make-next-error<ret>
----
-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
(See <<expansions#`:doc expansions`>>). For example:
----
-map global normal = ': echo Got count %val{count} and reg %val{register}<ret>'
+map global normal = ':echo Got count %val{count} and reg %val{register}<ret>'
----
== Mappable keys
diff --git a/rc/filetype/diff.kak b/rc/filetype/diff.kak
index 2655b9b5..5be241f2 100644
--- a/rc/filetype/diff.kak
+++ b/rc/filetype/diff.kak
@@ -4,7 +4,7 @@ hook global BufCreate .*\.(diff|patch) %{
hook global WinSetOption filetype=diff %{
require-module diff
- map buffer normal <ret> %{: diff-jump<ret>}
+ map buffer normal <ret> :diff-jump<ret>
}
hook -group diff-highlight global WinSetOption filetype=diff %{
diff --git a/rc/filetype/mail.kak b/rc/filetype/mail.kak
index 9fb2d14e..92c2e17c 100644
--- a/rc/filetype/mail.kak
+++ b/rc/filetype/mail.kak
@@ -4,9 +4,9 @@ hook global BufCreate .+\.eml %{
hook global WinSetOption filetype=mail %{
require-module mail
- map buffer normal <ret> %{: diff-jump<ret>}
+ map buffer normal <ret> :diff-jump<ret>
hook -once -always window WinSetOption filetype=.* %{
- unmap buffer normal <ret> %{: diff-jump<ret>}
+ unmap buffer normal <ret> :diff-jump<ret>
}
}
diff --git a/rc/tools/doc.kak b/rc/tools/doc.kak
index d5227ee4..e710a80f 100644
--- a/rc/tools/doc.kak
+++ b/rc/tools/doc.kak
@@ -131,7 +131,7 @@ define-command -params 1 -hidden doc-render %{
set-option buffer readonly true
add-highlighter buffer/ ranges doc_render_ranges
add-highlighter buffer/ wrap -word -indent
- map buffer normal <ret> ': doc-follow-link<ret>'
+ map buffer normal <ret> :doc-follow-link<ret>
}
define-command -params 0..2 \
diff --git a/rc/tools/git.kak b/rc/tools/git.kak
index d361a6c7..d8e7ef87 100644
--- a/rc/tools/git.kak
+++ b/rc/tools/git.kak
@@ -104,8 +104,8 @@ define-command -params 1.. \
# We need to unmap in case an existing buffer changes type,
# for example if the user runs "git show" and "git status".
map_diff_goto_source=$([ -n "${map_diff_goto_source}" ] \
- && printf %s "map buffer normal <ret> %[: git-diff-goto-source<ret>] -docstring 'Jump to source from git diff'" \
- || printf %s "unmap buffer normal <ret> %[: git-diff-goto-source<ret>]")
+ && printf %s "map buffer normal <ret> :git-diff-goto-source<ret> -docstring 'Jump to source from git diff'" \
+ || printf %s "unmap buffer normal <ret> :git-diff-goto-source<ret>")
printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{
edit! -fifo ${output} *git*
diff --git a/rc/tools/man.kak b/rc/tools/man.kak
index facfaedf..d2b7a16b 100644
--- a/rc/tools/man.kak
+++ b/rc/tools/man.kak
@@ -14,7 +14,7 @@ hook -group man-highlight global WinSetOption filetype=man %{
# References to other manpages
add-highlighter window/man-highlight/ regex [-a-zA-Z0-9_.]+\([a-z0-9]+\) 0:header
- map window normal <ret> ': man-jump<ret>'
+ map window normal <ret> :man-jump<ret>
hook -once -always window WinSetOption filetype=.* %{
remove-highlighter window/man-highlight
@@ -141,7 +141,7 @@ man-jump %{
# Suggested keymaps for a user mode
declare-user-mode man
-map global man 'g' -docstring 'Jump to a man page using selected man page link' ': man-jump<ret>'
-map global man 'j' -docstring 'Go to next man page link' ': man-link-next<ret>'
-map global man 'k' -docstring 'Go to previous man page link' ': man-link-prev<ret>'
-map global man 'm' -docstring 'Look up a man page' ':man<space>'
+map global man 'g' -docstring 'Jump to a man page using selected man page link' :man-jump<ret>
+map global man 'j' -docstring 'Go to next man page link' :man-link-next<ret>
+map global man 'k' -docstring 'Go to previous man page link' :man-link-prev<ret>
+map global man 'm' -docstring 'Look up a man page' :man<space>
diff --git a/src/commands.cc b/src/commands.cc
index 84e0fdf3..46481b9d 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -2621,6 +2621,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};