diff src/ex_docmd.c @ 22208:a607f02fd17a v8.2.1653

patch 8.2.1653: expand('<stack>') does not include the final line number Commit: https://github.com/vim/vim/commit/4f25b1aba050b85fa97ca2316aa04dd4b0b22530 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 10 19:25:05 2020 +0200 patch 8.2.1653: expand('<stack>') does not include the final line number Problem: Expand('<stack>') does not include the final line number. Solution: Add the line nuber. (closes https://github.com/vim/vim/issues/6927)
author Bram Moolenaar <Bram@vim.org>
date Thu, 10 Sep 2020 19:30:05 +0200
parents 6941d3205be9
children d7c1e3efa88e
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8389,6 +8389,7 @@ find_cmdline_var(char_u *src, int *usedl
  *	  '<cexpr>' to C-expression under the cursor
  *	  '<cfile>' to path name under the cursor
  *	  '<sfile>' to sourced file name
+ *	  '<stack>' to call stack
  *	  '<slnum>' to sourced file line number
  *	  '<afile>' to file name for autocommand
  *	  '<abuf>'  to buffer number for autocommand
@@ -8606,7 +8607,8 @@ eval_vars(
 
 	case SPEC_SFILE:	// file name for ":so" command
 	case SPEC_STACK:	// call stack
-		result = estack_sfile(spec_idx == SPEC_SFILE);
+		result = estack_sfile(spec_idx == SPEC_SFILE
+						? ESTACK_SFILE : ESTACK_STACK);
 		if (result == NULL)
 		{
 		    *errormsg = spec_idx == SPEC_SFILE