comparison runtime/doc/cmdline.txt @ 28403:2655935b5ccc v8.2.4726

patch 8.2.4726: cannot use expand() to get the script name Commit: https://github.com/vim/vim/commit/6013d0045dec7ca7c0068fbe186c42d754a7368b Author: LemonBoy <thatlemon@gmail.com> Date: Sat Apr 9 21:42:10 2022 +0100 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 https://github.com/vim/vim/issues/10121)
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Apr 2022 22:45:03 +0200
parents d19b7aee1925
children f73a9bdff3a3
comparison
equal deleted inserted replaced
28402:401c4206d38c 28403:2655935b5ccc
937 *:<sfile>* *<sfile>* 937 *:<sfile>* *<sfile>*
938 <sfile> When executing a ":source" command, is replaced with the 938 <sfile> When executing a ":source" command, is replaced with the
939 file name of the sourced file. *E498* 939 file name of the sourced file. *E498*
940 When executing a legacy function, is replaced with the call 940 When executing a legacy function, is replaced with the call
941 stack, as with <stack> (this is for backwards 941 stack, as with <stack> (this is for backwards
942 compatibility, using <stack> is preferred). 942 compatibility, using <stack> or <script> is preferred).
943 In Vim9 script using <sfile> in a function gives error 943 In Vim9 script using <sfile> in a function gives error
944 *E1245* . 944 *E1245* .
945 Note that filename-modifiers are useless when <sfile> is 945 Note that filename-modifiers are useless when <sfile> is
946 not used inside a script. 946 not used inside a script.
947 *:<stack>* *<stack>* 947 *:<stack>* *<stack>*
949 "function {function-name}[{lnum}]" for a function line 949 "function {function-name}[{lnum}]" for a function line
950 and "script {file-name}[{lnum}]" for a script line, and 950 and "script {file-name}[{lnum}]" for a script line, and
951 ".." in between items. E.g.: 951 ".." in between items. E.g.:
952 "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" 952 "function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
953 If there is no call stack you get error *E489* . 953 If there is no call stack you get error *E489* .
954 *:<script>* *<script>*
955 <script> When executing a `:source` command, is replaced with the file
956 name of the sourced file. When executing a function, is
957 replaced with the file name of the script where it is
958 defined.
959 If the file name cannot be determined you get error *E1274* .
954 *:<slnum>* *<slnum>* 960 *:<slnum>* *<slnum>*
955 <slnum> When executing a ":source" command, is replaced with the 961 <slnum> When executing a ":source" command, is replaced with the
956 line number. *E842* 962 line number. *E842*
957 When executing a function it's the line number relative to 963 When executing a function it's the line number relative to
958 the start of the function. 964 the start of the function.