diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-09 21:42:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-09 21:42:10 +0100 |
commit | 6013d0045dec7ca7c0068fbe186c42d754a7368b (patch) | |
tree | 739c5e84ced49602b15e033e3af9c909f9cc3e50 /runtime/doc/cmdline.txt | |
parent | 2ce97ae6aaec7007cca16a446d73161b82f2ba69 (diff) |
patch 8.2.4726: cannot use expand() to get the script namev8.2.4726
Problem: Cannot use expand() to get the script name.
Solution: Support expand('<script>'). (closes #10121)
Diffstat (limited to 'runtime/doc/cmdline.txt')
-rw-r--r-- | runtime/doc/cmdline.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 0867c47fa4..cd9b988a74 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -939,7 +939,7 @@ Note: these are typed literally, they are not special keys! file name of the sourced file. *E498* When executing a legacy function, is replaced with the call stack, as with <stack> (this is for backwards - compatibility, using <stack> is preferred). + compatibility, using <stack> or <script> is preferred). In Vim9 script using <sfile> in a function gives error *E1245* . Note that filename-modifiers are useless when <sfile> is @@ -951,6 +951,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* |