diff src/eval.c @ 25220:89b39ce243e2 v8.2.3146

patch 8.2.3146: Vim9: line number wrong for :execute argument Commit: https://github.com/vim/vim/commit/c03fe66ade4c79a4eb5fc05d1d549c8f931a04b6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 11 16:52:45 2021 +0200 patch 8.2.3146: Vim9: line number wrong for :execute argument Problem: Vim9: line number wrong for :execute argument. Solution: Use the line number of the :execute command itself. (closes https://github.com/vim/vim/issues/8537)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jul 2021 17:00:04 +0200
parents 9ead67e3c696
children d26dc79c533f
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -6191,6 +6191,7 @@ ex_execute(exarg_T *eap)
     char_u	*p;
     garray_T	ga;
     int		len;
+    long	start_lnum = SOURCING_LNUM;
 
     ga_init2(&ga, 1, 80);
 
@@ -6244,6 +6245,9 @@ ex_execute(exarg_T *eap)
 
     if (ret != FAIL && ga.ga_data != NULL)
     {
+	// use the first line of continuation lines for messages
+	SOURCING_LNUM = start_lnum;
+
 	if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echoerr)
 	{
 	    // Mark the already saved text as finishing the line, so that what