From a2e48b556b7537acd26353b6cc201410be7cf3dc Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 25 Aug 2019 13:45:45 +0900 Subject: vim-patch:8.1.0362: cannot get the script line number when executing a function Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761 --- runtime/doc/cmdline.txt | 27 ++++++++++++++++----------- runtime/doc/eval.txt | 6 +++++- 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 119fd924f1..46248899a0 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -816,11 +816,12 @@ it, no matter how many backslashes. \\# \# Also see |`=|. - *:* *:* *:* ** - *:* ** *:* ** - *:* ** *:* ** - *:* ** - ** *E495* *E496* *E497* *E499* *E500* + *:* ** *:* ** + *:* ** *:* ** + *:* ** *:* ** + *:* ** + *:* ** *:* ** + *:* ** *E499* *E500* Note: these are typed literally, they are not special keys! is replaced with the word under the cursor (like |star|) is replaced with the WORD under the cursor (see |WORD|) @@ -833,15 +834,16 @@ Note: these are typed literally, they are not special keys! |gf| uses) When executing autocommands, is replaced with the file name of the buffer being manipulated, or the file for a read or - write. + write. *E495* 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* When executing autocommands, is replaced with the match for - which this autocommand was executed. It differs from - 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 only when the file name isn't used + to match with (for FileType, Syntax and SpellFileMissing + events). When executing a ":source" command, is replaced with the file name of the sourced file. *E498* When executing a function, is replaced with: @@ -851,9 +853,12 @@ Note: these are typed literally, they are not special keys! Note that filename-modifiers are useless when is used inside a function. 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. + When executing a script, is replaced with the line number. + It differs from in that 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 06f88955c9..97ca804c9a 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3592,7 +3592,10 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()* autocmd buffer number (as a String!) autocmd matched name sourced script file or function name - sourced script file line number + sourced script line number or function + line number + script file line number, also when in + a function word under the cursor WORD under the cursor the {clientid} of the last received @@ -5702,6 +5705,7 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* (|mapmode-ic|) "sid" The script local ID, used for mappings (||). + "lnum" The line number in "sid", zero if unknown. "nowait" Do not wait for other, longer mappings. (|:map-|). -- cgit From 9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4 Mon Sep 17 00:00:00 2001 From: erw7 Date: Thu, 29 Aug 2019 13:07:03 +0900 Subject: vim-patch:8.1.0515: reloading a script gives errors for existing functions Problem: Reloading a script gives errors for existing functions. Solution: Allow redefining a function once when reloading a script. https://github.com/vim/vim/commit/ded5f1bed7ff2d138b3ee0f9610d17290b62692d --- runtime/doc/eval.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 97ca804c9a..d8c1132906 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9238,9 +9238,13 @@ See |:verbose-cmd| for more information. deleted if there are no more references to it. *E127* *E122* When a function by this name already exists and [!] is - not used an error message is given. When [!] is used, - an existing function is silently replaced. Unless it - is currently being executed, that is an error. + not used an error message is given. There is one + exception: When sourcing a script again, a function + that was previously defined in that script will be + silently replaced. + When [!] is used, an existing function is silently + replaced. Unless it is currently being executed, that + is an error. NOTE: Use ! wisely. If used without care it can cause an existing function to be replaced unexpectedly, which is hard to debug. -- cgit