1
0
forked from aniani/vim

patch 9.1.0397: Wrong display with 'smoothscroll' when changing quickfix list

Problem:  Wrong display with 'smoothscroll' when changing quickfix list.
Solution: Reset w_skipcol when replacing quickfix list (zeertzjq).

closes: #14730

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-05-08 20:22:40 +02:00
committed by Christian Brabandt
parent 6a4ea471d2
commit c7a8eb5ff2
9 changed files with 155 additions and 0 deletions

View File

@@ -961,6 +961,51 @@ func Test_smoothscroll_insert_bottom()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_qf_window()
CheckFeature quickfix
CheckScreendump
let lines =<< trim END
set nocompatible display=lastline
copen 5
setlocal number smoothscroll
let g:l = [{'text': 'foo'}] + repeat([{'text': join(range(30))}], 10)
call setqflist(g:l, 'r')
normal! G
wincmd t
let g:l1 = [{'text': join(range(1000))}]
END
call writefile(lines, 'XSmoothScrollInQfWindow', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollInQfWindow', #{rows: 20, cols: 60})
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_1', {})
call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_2', {})
call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_3', {})
call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_4', {})
call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_5', {})
call term_sendkeys(buf, ":call setqflist([], 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_2', {})
call term_sendkeys(buf, ":call setqflist(g:l1, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_4', {})
call term_sendkeys(buf, "\<C-W>b$\<C-W>t")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_5', {})
call term_sendkeys(buf, ":call setqflist(g:l, 'r')\<CR>")
call VerifyScreenDump(buf, 'Test_smoothscroll_in_qf_window_3', {})
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_in_zero_width_window()
set cpo+=n number smoothscroll
set winwidth=99999 winminwidth=0