aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorChristian Clason <christian.clason@uni-due.de>2020-06-03 16:51:25 +0200
committerGitHub <noreply@github.com>2020-06-03 10:51:25 -0400
commit8a1276005a1099187710bdcc19284de51a0aa89a (patch)
treebda3d6bb3a448c171539d8367d281816664212ae /runtime
parent60c581b35db439dd6b32cdc2ebe1a5aed933b44c (diff)
downloadrneovim-8a1276005a1099187710bdcc19284de51a0aa89a.tar.gz
rneovim-8a1276005a1099187710bdcc19284de51a0aa89a.tar.bz2
rneovim-8a1276005a1099187710bdcc19284de51a0aa89a.zip
Add v:event.visual during `TextYankPost` (#12382)
* propagate visual selection to textyankpost event * adapt tests * add docs * also adapt oldtest
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt1
-rw-r--r--runtime/doc/eval.txt2
-rw-r--r--runtime/doc/lua.txt4
3 files changed, 7 insertions, 0 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 64ca7b6a45..f1753b75cc 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -844,6 +844,7 @@ TextYankPost Just after a |yank| or |deleting| command, but not
regcontents
regname
regtype
+ visual
The `inclusive` flag combined with the |'[|
and |']| marks can be used to calculate the
precise region of the operation.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 214d815006..7f50769023 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1591,6 +1591,8 @@ v:event Dictionary of event data for the current |autocommand|. Valid
operation.
regtype Type of register as returned by
|getregtype()|.
+ visual Selection is visual (as opposed to,
+ e.g., via motion).
completed_item Current selected complete item on
|CompleteChanged|, Is `{}` when no complete
item selected.
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 7c1b0ee73b..5a49d36503 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -705,6 +705,10 @@ the highlight via
>
au TextYankPost * silent! lua require'vim.highlight'.on_yank("IncSearch", 500)
<
+If you want to exclude visual selections from highlighting on yank, use
+>
+au TextYankPost * silent! lua return (not vim.v.event.visual) and require'vim.highlight'.on_yank()
+<
vim.highlight.on_yank([{higroup}, {timeout}, {event}])
*vim.highlight.on_yank()*