summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-10 21:05:02 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-10 21:05:02 +0200
commitf29c1c6aa3f365c025890fab5fb9efbe88eb1761 (patch)
tree3cd43ee75a7e0fbdce4902426512ae804b1c7ff0 /runtime
parent6b0b83f768cf536b34ce4d3f2de6bf62324229aa (diff)
patch 8.1.0362: cannot get the script line number when executing a functionv8.1.0362
Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes #3362) Also display the line number with ":verbose set".
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/cmdline.txt27
-rw-r--r--runtime/doc/eval.txt6
2 files changed, 21 insertions, 12 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index df18ec6c45..3b2dd32060 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -832,11 +832,12 @@ it, no matter how many backslashes.
\\# \#
Also see |`=|.
- *:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
- *:<sfile>* *<sfile>* *:<afile>* *<afile>*
- *:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
- *:<cexpr>* *<cexpr>*
- *<slnum>* *E495* *E496* *E497* *E499* *E500*
+ *:<cword>* *<cword>* *:<cWORD>* *<cWORD>*
+ *:<cexpr>* *<cexpr>* *:<cfile>* *<cfile>*
+ *:<afile>* *<afile>* *:<abuf>* *<abuf>*
+ *:<amatch>* *<amatch>*
+ *:<sfile>* *<sfile>* *:<slnum>* *<slnum>*
+ *:<sflnum>* *<sflnum>* *E499* *E500*
Note: these are typed literally, they are not special keys!
<cword> is replaced with the word under the cursor (like |star|)
<cWORD> is replaced with the WORD under the cursor (see |WORD|)
@@ -849,15 +850,16 @@ Note: these are typed literally, they are not special keys!
|gf| uses)
<afile> When executing autocommands, is replaced with the file name
of the buffer being manipulated, or the file for a read or
- write.
+ write. *E495*
<abuf> When executing autocommands, is replaced with the currently
effective buffer number (for ":r file" and ":so file" it is
the current buffer, the file being read/sourced is not in a
- buffer).
+ buffer). *E496*
<amatch> When executing autocommands, is replaced with the match for
- which this autocommand was executed. It differs from
- <afile> only when the file name isn't used to match with
- (for FileType, Syntax and SpellFileMissing events).
+ which this autocommand was executed. *E497*
+ It differs from <afile> only when the file name isn't used
+ to match with (for FileType, Syntax and SpellFileMissing
+ events).
<sfile> When executing a ":source" command, is replaced with the
file name of the sourced file. *E498*
When executing a function, is replaced with:
@@ -867,9 +869,12 @@ Note: these are typed literally, they are not special keys!
Note that filename-modifiers are useless when <sfile> is
used inside a function.
<slnum> When executing a ":source" command, is replaced with the
- line number. *E842*
+ line number. *E842*
When executing a function it's the line number relative to
the start of the function.
+ <sflnum> When executing a script, is replaced with the line number.
+ It differs from <slnum> in that <sflnum> is replaced with
+ the script line number in any situation. *E961*
*filename-modifiers*
*:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S*
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 21cb4abade..2ff124b691 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3798,7 +3798,10 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
<abuf> autocmd buffer number (as a String!)
<amatch> autocmd matched name
<sfile> sourced script file or function name
- <slnum> sourced script file line number
+ <slnum> sourced script line number or function
+ line number
+ <sflnum> script file line number, also when in
+ a function
<cword> word under the cursor
<cWORD> WORD under the cursor
<client> the {clientid} of the last received
@@ -5931,6 +5934,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
(|mapmode-ic|)
"sid" The script local ID, used for <sid> mappings
(|<SID>|).
+ "lnum" The line number in "sid", zero if unknown.
"nowait" Do not wait for other, longer mappings.
(|:map-<nowait>|).