aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-29 20:46:44 -0400
committerGitHub <noreply@github.com>2021-03-29 20:46:44 -0400
commit3f447d928debe9a632ddb170ed276c20de2b1586 (patch)
treeee247610947f7eec56135a0f7bc91df3e628fae1 /runtime
parent3c497e214f48ee1433d759f5a56c028df5186f24 (diff)
parent756f55959986eaa0de07a46e30512d7031766252 (diff)
downloadrneovim-3f447d928debe9a632ddb170ed276c20de2b1586.tar.gz
rneovim-3f447d928debe9a632ddb170ed276c20de2b1586.tar.bz2
rneovim-3f447d928debe9a632ddb170ed276c20de2b1586.zip
Merge pull request #14248 from andymass/vim-8.2.2612
[RFC] vim-patch 8.2.{2612,2613}
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/map.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index edec4a8de7..3ee26b0817 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -224,6 +224,20 @@ text before the cursor and start omni completion when some condition is met.
For abbreviations |v:char| is set to the character that was typed to trigger
the abbreviation. You can use this to decide how to expand the {lhs}. You
should not either insert or change the v:char.
+
+Also, keep in mind that the expression may be evaluated when looking for
+typeahead, before the previous command has been executed. For example: >
+ func StoreColumn()
+ let g:column = col('.')
+ return 'x'
+ endfunc
+ nnoremap <expr> x StoreColumn()
+ nmap ! f!x
+You will notice that g:column has the value from before executing "fx",
+because "z" is evaluated before "fx" is executed.
+This can be solved by inserting <Ignore> before the character that is
+expression-mapped: >
+ nmap ! f!<Ignore>x
Be very careful about side effects! The expression is evaluated while
obtaining characters, you may very well make the command dysfunctional.