diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-20 07:54:14 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-23 17:47:46 +0800 |
commit | ffa1335047047ac00280ac742bcc6dfcc7fa3589 (patch) | |
tree | b71be77bcee6dfb6e3f96f154c2e8a77cdf4170d /runtime | |
parent | 42e9fe7d958e0ba025034c330d8e29293d828b60 (diff) | |
download | rneovim-ffa1335047047ac00280ac742bcc6dfcc7fa3589.tar.gz rneovim-ffa1335047047ac00280ac742bcc6dfcc7fa3589.tar.bz2 rneovim-ffa1335047047ac00280ac742bcc6dfcc7fa3589.zip |
vim-patch:8.2.4726: cannot use expand() to get the script name
Problem: Cannot use expand() to get the script name.
Solution: Support expand('<script>'). (closes vim/vim#10121)
https://github.com/vim/vim/commit/6013d0045dec7ca7c0068fbe186c42d754a7368b
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 2 | ||||
-rw-r--r-- | runtime/doc/cmdline.txt | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index a47eae8274..2bd0415dab 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2013,6 +2013,8 @@ expand({string} [, {nosuf} [, {list}]]) *expand()* a function <SID> "<SNR>123_" where "123" is the current script ID |<SID>| + <script> sourced script file, or script file + where the current function was defined <stack> call stack <cword> word under the cursor <cWORD> WORD under the cursor diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 29eff75bfa..f19671e713 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -881,7 +881,7 @@ Note: these are typed literally, they are not special keys! file name of the sourced file. *E498* When executing a function, is replaced with the call stack, as with <stack> (this is for backwards compatibility, using - <stack> is preferred). + <stack> or <script> is preferred). Note that filename-modifiers are useless when <sfile> is not used inside a script. *:<stack>* *<stack>* @@ -891,6 +891,12 @@ Note: these are typed literally, they are not special keys! ".." in between items. E.g.: "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" If there is no call stack you get error *E489* . + *:<script>* *<script>* + <script> When executing a `:source` command, is replaced with the file + name of the sourced file. When executing a function, is + replaced with the file name of the script where it is + defined. + If the file name cannot be determined you get error *E1274* . *:<slnum>* *<slnum>* <slnum> When executing a `:source` command, is replaced with the line number. *E842* |