Patch 8.2.3248
Problem:    Vim9: error message for wrong input uses wrong line number.
Solution:   Use the line number of the start of the command. (issue #8653)
Files:      src/vim9script.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3247/src/vim9script.c    2021-07-25 14:13:50.040566339 +0200
--- src/vim9script.c    2021-07-29 22:24:13.162297764 +0200
***************
*** 411,416 ****
--- 411,417 ----
      int               mult = FALSE;
      garray_T  names;
      garray_T  as_names;
+     long      start_lnum = SOURCING_LNUM;
  
      tv.v_type = VAR_UNKNOWN;
      ga_init2(&names, sizeof(char_u *), 10);
***************
*** 511,516 ****
--- 512,520 ----
      }
      cmd_end = arg;
  
+     // Give error messages for the start of the line.
+     SOURCING_LNUM = start_lnum;
+ 
      /*
       * find script file
       */
*** ../vim-8.2.3247/src/testdir/test_vim9_script.vim    2021-07-27 
22:00:39.753712380 +0200
--- src/testdir/test_vim9_script.vim    2021-07-29 22:24:02.714318042 +0200
***************
*** 1223,1228 ****
--- 1223,1238 ----
    writefile(import_star_as_lines_dot_space, 'Ximport.vim')
    assert_fails('source Ximport.vim', 'E1074:', '', 1, 'Func')
  
+   var import_func_duplicated =<< trim END
+     vim9script
+     import ExportedInc from './Xexport.vim'
+     import ExportedInc from './Xexport.vim'
+ 
+     ExportedInc()
+   END
+   writefile(import_func_duplicated, 'Ximport.vim')
+   assert_fails('source Ximport.vim', 'E1073:', '', 3, 'Ximport.vim')
+ 
    var import_star_as_duplicated =<< trim END
      vim9script
      import * as Export from './Xexport.vim'
*** ../vim-8.2.3247/src/version.c       2021-07-29 21:23:46.829817787 +0200
--- src/version.c       2021-07-29 22:18:54.114896796 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3248,
  /**/

-- 
press CTRL-ALT-DEL for more information

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202107292025.16TKPxqv2237755%40masaka.moolenaar.net.

Raspunde prin e-mail lui