Patch 9.0.0715
Problem:    Wrong argument for append() gives two error messages.
Solution:   When getting an error for a number argument don't try using it as
            a string. (closes #11335)
Files:      src/typval.c, src/testdir/test_functions.vim


*** ../vim-9.0.0714/src/typval.c        2022-09-17 21:07:52.099993159 +0100
--- src/typval.c        2022-10-10 16:00:57.687434142 +0100
***************
*** 2509,2518 ****
  tv_get_lnum(typval_T *argvars)
  {
      linenr_T  lnum = -1;
  
      if (argvars[0].v_type != VAR_STRING || !in_vim9script())
        lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
!     if (lnum <= 0 && argvars[0].v_type != VAR_NUMBER)
      {
        int     fnum;
        pos_T   *fp;
--- 2509,2520 ----
  tv_get_lnum(typval_T *argvars)
  {
      linenr_T  lnum = -1;
+     int               did_emsg_before = did_emsg;
  
      if (argvars[0].v_type != VAR_STRING || !in_vim9script())
        lnum = (linenr_T)tv_get_number_chk(&argvars[0], NULL);
!     if (lnum <= 0 && did_emsg_before == did_emsg
!                                           && argvars[0].v_type != VAR_NUMBER)
      {
        int     fnum;
        pos_T   *fp;
*** ../vim-9.0.0714/src/testdir/test_functions.vim      2022-09-27 
19:34:30.662212363 +0100
--- src/testdir/test_functions.vim      2022-10-10 16:00:26.795513811 +0100
***************
*** 950,955 ****
--- 950,957 ----
  
    " Using $ instead of '$' must give an error
    call assert_fails("call append($, 'foobar')", 'E116:')
+ 
+   call assert_fails("call append({}, '')", ['E728:', 'E728:'])
  endfunc
  
  " Test for setline()
*** ../vim-9.0.0714/src/version.c       2022-10-10 15:39:43.157010978 +0100
--- src/version.c       2022-10-10 15:58:32.411818478 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     715,
  /**/

-- 
Vim is like Emacs without all the typing.  (John "Johann" Spetz)

 /// 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/20221010151157.639741C5298%40moolenaar.net.

Raspunde prin e-mail lui