Patch 8.2.3357

3 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 17, 2021, 4:16:00 PM8/17/21
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages