summaryrefslogtreecommitdiffstats
path: root/runtime/doc/map.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-01-12 23:22:24 +0000
committerBram Moolenaar <Bram@vim.org>2006-01-12 23:22:24 +0000
commit4770d09abd866bb53d95895dc6a5c5fe7cccb619 (patch)
treeb9ca6f4a66c7591a84cfe88fb21edb31db906a4e /runtime/doc/map.txt
parent1cbe5f739d4e75b5e16b85ae79ff0434a641b03d (diff)
updated for version 7.0179v7.0179
Diffstat (limited to 'runtime/doc/map.txt')
-rw-r--r--runtime/doc/map.txt11
1 files changed, 5 insertions, 6 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 90ebe06ebc..85155b439d 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 7.0aa. Last change: 2005 Dec 17
+*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -946,11 +946,10 @@ local function or uses a local mapping.
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
-use this trick: >
- :map <SID>xx <SID>xx
- :let s:sid = maparg("<SID>xx")
- :unmap <SID>xx
-And remove the trailing "xx".
+use this function: >
+ function s:SID()
+ return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
+ endfun
The "<SNR>" will be shown when listing functions and mappings. This is useful
to find out what they are defined to.