mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
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)
6013d0045d
Use `.sn_name` instead of `->sn_name` as v8.2.0154 hasn't been ported.
Cherry-pick builtin.txt expand() doc from latest Vim.
This commit is contained in:
@@ -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
|
||||
|
@@ -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*
|
||||
|
Reference in New Issue
Block a user