summaryrefslogtreecommitdiffstats
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-01 20:45:11 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-01 20:45:11 +0200
commit909443028b57d7514ce3c71f00e9d808f2126b4f (patch)
tree1d574ce00cdb456fbd241dadb493ed652d657a40 /runtime/doc/map.txt
parent491799be5084dde7aa3367462f306e7b71dbc4a5 (diff)
patch 8.2.1347: cannot easily get the script IDv8.2.1347
Problem: Cannot easily get the script ID. Solution: Support expand('<SID>').
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 0ad43d449b..79c46f7125 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1167,6 +1167,10 @@ When executing an autocommand or a user command, it will run in the context of
the script it was defined in. This makes it possible that the command calls a
local function or uses a local mapping.
+In case the value is used in a context where <SID> cannot be correctly
+expanded, use the expand() function: >
+ let &includexpr = expand('<SID>') .. 'My_includeexpr()'
+
Otherwise, using "<SID>" outside of a script context is an error.
If you need to get the script number to use in a complicated script, you can