> In the example the function is called s:SID, and that's what is being
> matched.  I don't think this needs to change 

If somebody copy this code and rename function, pattern will not match.
Since the function name can't contain angle brackets, not necessarily
appending it to pattern.

> It's good to give a hint that it may be a function name, however adding
> too much text causes the line to wrap and that spoils the looks of the
> table.

I add few sentences and example:

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff -r c2098c3095e7 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt      Sat Mar 08 18:38:28 2014 +0100
+++ b/runtime/doc/eval.txt      Tue Mar 11 23:34:31 2014 +0700
@@ -2841,6 +2841,19 @@
                "~/" expanded into the path of the home directory: >
                        :echo expand(expand("<cfile>"))
 <
+               Expanding of "<sfile>" is context depended. In global scope it
+               returns file name of sources file (|:source|), Inside function
+               it returns function name (|:<sfile>|). Sourcing of file
+               with lines >
+                       :function s:foo()
+                       :  return expand( '<sfile>' )
+                       :endfunction
+                       :echo expand( '<sfile>' )
+                       :echo s:foo()
+<              will output text like >
+                       /tmp/script.vim
+                       function <SNR>12_foo
+<
                There cannot be white space between the variables and the
                following modifier.  The |fnamemodify()| function can be used
                to modify normal file names.
diff -r c2098c3095e7 runtime/doc/map.txt
--- a/runtime/doc/map.txt       Sat Mar 08 18:38:28 2014 +0100
+++ b/runtime/doc/map.txt       Tue Mar 11 23:34:31 2014 +0700
@@ -1105,7 +1105,7 @@
 If you need to get the script number to use in a complicated script, you can
 use this function: >
        function s:SID()
-         return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
+         return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_')
        endfun
 
 The "<SNR>" will be shown when listing functions and mappings.  This is useful

Raspunde prin e-mail lui