Patch 8.2.3357
Problem:    Crash when 'virtualedit' is set and window is narrow.
Solution:   Check that width is not zero. (closes #8767)
Files:      src/misc2.c, src/testdir/test_number.vim


*** ../vim-8.2.3356/src/misc2.c 2021-08-06 21:51:33.896689086 +0200
--- src/misc2.c 2021-08-17 22:04:21.119685455 +0200
***************
*** 161,167 ****
        if (finetune
                && curwin->w_p_wrap
                && curwin->w_width != 0
!               && wcol >= (colnr_T)width)
        {
            csize = linetabsize(line);
            if (csize > 0)
--- 161,168 ----
        if (finetune
                && curwin->w_p_wrap
                && curwin->w_width != 0
!               && wcol >= (colnr_T)width
!               && width > 0)
        {
            csize = linetabsize(line);
            if (csize > 0)
*** ../vim-8.2.3356/src/testdir/test_number.vim 2021-06-16 19:28:30.508346274 
+0200
--- src/testdir/test_number.vim 2021-08-17 22:00:55.144431838 +0200
***************
*** 320,323 ****
--- 320,334 ----
    bw!
  endfunc
  
+ " This used to cause a divide by zero
+ func Test_number_no_text_virtual_edit()
+   vnew
+   call setline(1, ['line one', 'line two'])
+   set number virtualedit=all
+   normal w
+   4wincmd |
+   normal j
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3356/src/version.c       2021-08-16 21:38:38.131122584 +0200
--- src/version.c       2021-08-17 22:04:40.663614615 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3357,
  /**/

-- 
The Law, in its majestic equality, forbids the rich, as well as the
poor, to sleep under the bridges, to beg in the streets, and to steal
bread.                       -- Anatole France

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202108172015.17HKFrLA124359%40masaka.moolenaar.net.

Raspunde prin e-mail lui