mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-patch:9.1.0730: Crash with cursor-screenline and narrow window
Problem: Crash with cursor-screenline and narrow window (elig0n) Solution: Don't set right_col when width2 is 0 (zeertzjq). fixes: vim/vim#15677 closes: vim/vim#1567859149f0269
(cherry picked from commit5191a11d66
)
This commit is contained in:
committed by
github-actions[bot]
parent
b4824edac1
commit
4abd480e8f
@ -189,7 +189,7 @@ static void margin_columns_win(win_T *wp, int *left_col, int *right_col)
|
|||||||
*left_col = 0;
|
*left_col = 0;
|
||||||
*right_col = width1;
|
*right_col = width1;
|
||||||
|
|
||||||
if (wp->w_virtcol >= (colnr_T)width1) {
|
if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) {
|
||||||
*right_col = width1 + ((wp->w_virtcol - width1) / width2 + 1) * width2;
|
*right_col = width1 + ((wp->w_virtcol - width1) / width2 + 1) * width2;
|
||||||
}
|
}
|
||||||
if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) {
|
if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) {
|
||||||
|
@ -300,7 +300,7 @@ func Test_cursorline_screenline_update()
|
|||||||
set cursorline cursorlineopt=screenline
|
set cursorline cursorlineopt=screenline
|
||||||
inoremap <F2> <Cmd>call cursor(1, 1)<CR>
|
inoremap <F2> <Cmd>call cursor(1, 1)<CR>
|
||||||
END
|
END
|
||||||
call writefile(lines, 'Xcul_screenline')
|
call writefile(lines, 'Xcul_screenline', 'D')
|
||||||
|
|
||||||
let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
|
let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
|
||||||
call term_sendkeys(buf, "A")
|
call term_sendkeys(buf, "A")
|
||||||
@ -310,7 +310,17 @@ func Test_cursorline_screenline_update()
|
|||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xcul_screenline')
|
endfunc
|
||||||
|
|
||||||
|
func Test_cursorline_screenline_zero_width()
|
||||||
|
CheckOption foldcolumn
|
||||||
|
|
||||||
|
set cursorline culopt=screenline winminwidth=1 foldcolumn=1
|
||||||
|
" This used to crash Vim
|
||||||
|
1vnew | redraw
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
set cursorline& culopt& winminwidth& foldcolumn&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cursorline_cursorbind_horizontal_scroll()
|
func Test_cursorline_cursorbind_horizontal_scroll()
|
||||||
|
Reference in New Issue
Block a user