diff src/vim9execute.c @ 32483:933cec0b89dc v9.0.1573

patch 9.0.1573: error for function name has wrong line number Commit: https://github.com/vim/vim/commit/d4a9b7f61475f3166cce92b0bad748e8c1eb51fe Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 23 14:48:42 2023 +0100 patch 9.0.1573: error for function name has wrong line number Problem: Error for function name has wrong line number. Solution: Set the line number before giving the error.
author Bram Moolenaar <Bram@vim.org>
date Tue, 23 May 2023 16:00:06 +0200
parents 2e07c2bb2f60
children 9ae1bdff8457
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -4448,6 +4448,7 @@ exec_instructions(ectx_T *ectx)
 		    CLEAR_FIELD(ea);
 		    ea.cmd = ea.arg = iptr->isn_arg.string;
 		    ga_init2(&lines_to_free, sizeof(char_u *), 50);
+		    SOURCING_LNUM = iptr->isn_lnum;
 		    define_function(&ea, NULL, &lines_to_free, 0);
 		    ga_clear_strings(&lines_to_free);
 		}