Patch 9.0.1011
Problem:    ml_get error when using screenpos().
Solution:   Give an error for the line number. (closes #11661)
Files:      src/move.c, src/testdir/test_cursor_func.vim


*** ../vim-9.0.1010/src/move.c  2022-12-03 18:35:04.244951282 +0000
--- src/move.c  2022-12-05 16:21:12.243122671 +0000
***************
*** 1500,1505 ****
--- 1500,1510 ----
        return;
  
      pos.lnum = tv_get_number(&argvars[1]);
+     if (pos.lnum > wp->w_buffer->b_ml.ml_line_count)
+     {
+       semsg(_(e_invalid_line_number_nr), pos.lnum);
+       return;
+     }
      pos.col = tv_get_number(&argvars[2]) - 1;
      pos.coladd = 0;
      textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol);
*** ../vim-9.0.1010/src/testdir/test_cursor_func.vim    2022-11-12 
16:07:01.777944369 +0000
--- src/testdir/test_cursor_func.vim    2022-12-05 16:22:41.674999144 +0000
***************
*** 167,172 ****
--- 167,175 ----
    let pos = screenpos(winid, 1, 66)
    call assert_equal(winrow, pos.row)
    call assert_equal(wincol + 66 + 3, pos.col)
+ 
+   call assert_fails('echo screenpos(0, 2, 1)', 'E966:')
+ 
    close
    bwipe!
  endfunc
*** ../vim-9.0.1010/src/version.c       2022-12-05 15:50:38.218348287 +0000
--- src/version.c       2022-12-05 16:17:35.959043785 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1011,
  /**/

-- 
"The amigos also appear to be guilty of not citing the work of others who had
gone before them.  Even worse, they have a chapter about modeling time and
space without making a single reference to Star Trek!"
                        (Scott Ambler, reviewing the UML User Guide)

 /// 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/20221205162422.5E2211C1D3C%40moolenaar.net.

Raspunde prin e-mail lui