mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3357: crash when 'virtualedit' is set and window is narrow
Problem: Crash when 'virtualedit' is set and window is narrow. ()
Solution: Check that width is not zero. (closes vim/vim#8767)
02f8694a6b
This commit is contained in:
parent
2ddfd6b999
commit
26b7faf1f2
@ -130,7 +130,8 @@ static int coladvance2(
|
|||||||
if (finetune
|
if (finetune
|
||||||
&& curwin->w_p_wrap
|
&& curwin->w_p_wrap
|
||||||
&& curwin->w_width_inner != 0
|
&& curwin->w_width_inner != 0
|
||||||
&& wcol >= (colnr_T)width) {
|
&& wcol >= (colnr_T)width
|
||||||
|
&& width > 0) {
|
||||||
csize = linetabsize(line);
|
csize = linetabsize(line);
|
||||||
if (csize > 0)
|
if (csize > 0)
|
||||||
csize--;
|
csize--;
|
||||||
|
@ -320,4 +320,15 @@ func Test_number_rightleft()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
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: shiftwidth=2 sts=2 expandtab
|
||||||
|
Loading…
Reference in New Issue
Block a user