diff 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
line wrap: on
line diff
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -939,7 +939,7 @@ Note: these are typed literally, they ar
 		   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 ar
 		   ".." 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*