summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-24 13:10:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-24 13:10:18 +0200
commit9c65253fe702ea010afec11aa971acd542c35de2 (patch)
treef2b6966699a238c27d7c0115827955678bc773a0 /runtime
parent3718427ba3c28ccab30726880389e44070640d3b (diff)
patch 8.2.0815: maparg() does not provide enough information for mapset()v8.2.0815
Problem: maparg() does not provide enough information for mapset(). Solution: Add "lhsraw" and "lhsrawalt" items. Drop "simplified"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt19
1 files changed, 13 insertions, 6 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index afda3505b1..1e0760fea2 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2586,7 +2586,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
rhs of mapping {name} in mode {mode}
mapcheck({name} [, {mode} [, {abbr}]])
String check for mappings matching {name}
-mapset({name}, {mode}, {abbr}, {dict}
+mapset({mode}, {abbr}, {dict})
none restore mapping from |maparg()| result
match({expr}, {pat} [, {start} [, {count}]])
Number position where {pat} matches in {expr}
@@ -6829,7 +6829,10 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
When {dict} is there and it is |TRUE| return a dictionary
containing all the information of the mapping with the
following items:
- "lhs" The {lhs} of the mapping.
+ "lhs" The {lhs} of the mapping as it would be typed
+ "lhsraw" The {lhs} of the mapping as raw bytes
+ "lhsrawalt" The {lhs} of the mapping as raw bytes, alternate
+ form, only present when it differs from "lhsraw"
"rhs" The {rhs} of the mapping as typed.
"silent" 1 for a |:map-silent| mapping, else 0.
"noremap" 1 if the {rhs} of the mapping is not remappable.
@@ -6847,7 +6850,6 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
"lnum" The line number in "sid", zero if unknown.
"nowait" Do not wait for other, longer mappings.
(|:map-<nowait>|).
- "simplified"
The dictionary can be used to restore a mapping with
|mapset()|.
@@ -6897,10 +6899,11 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
Can also be used as a |method|: >
GetKey()->mapcheck('n')
+
mapset({mode}, {abbr}, {dict}) *mapset()*
Restore a mapping from a dictionary returned by |maparg()|.
- {name}, {mode} and {abbr} should be the same as for the call
- to |maparg()|.
+ {mode} and {abbr} should be the same as for the call to
+ |maparg()|. *E460*
{mode} is used to define the mode in which the mapping is set,
not the "mode" entry in {dict}.
Example for saving and restoring a mapping: >
@@ -6908,7 +6911,11 @@ mapset({mode}, {abbr}, {dict}) *mapset()*
nnoremap K somethingelse
...
call mapset('n', 0, save_map)
-<
+< Note that if you are going to replace a map in several modes,
+ e.g. with `:map!`, you need to save the mapping for all of
+ them, since they can differe.
+
+
match({expr}, {pat} [, {start} [, {count}]]) *match()*
When {expr} is a |List| then this returns the index of the
first item where {pat} matches. Each item is used as a