mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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:
committed by
Christian Brabandt
parent
6a4ea471d2
commit
c7a8eb5ff2
@@ -319,6 +319,7 @@ update_topline(void)
|
||||
redraw_later(UPD_NOT_VALID);
|
||||
curwin->w_topline = 1;
|
||||
curwin->w_botline = 2;
|
||||
curwin->w_skipcol = 0;
|
||||
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
|
||||
curwin->w_scbind_pos = 1;
|
||||
}
|
||||
|
@@ -4867,6 +4867,9 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int qf_winid)
|
||||
|
||||
if (old_last == NULL)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (buf != curbuf)
|
||||
{
|
||||
internal_error("qf_fill_buffer()");
|
||||
@@ -4883,6 +4886,10 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int qf_winid)
|
||||
while ((curbuf->b_ml.ml_flags & ML_EMPTY) == 0)
|
||||
(void)ml_delete((linenr_T)1);
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
if (wp->w_buffer == curbuf)
|
||||
wp->w_skipcol = 0;
|
||||
|
||||
// Remove all undo information
|
||||
u_clearallandblockfree(curbuf);
|
||||
}
|
||||
|
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_1.dump
Normal file
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_1.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
> +0&#ffffff0@59
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+3#0000000&|N|o| |N|a|m|e|]| @50
|
||||
|<+0#4040ff13&@2| +0#af5f00255&|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|
||||
| +0#af5f00255&|1|0| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
|
||||
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|
||||
| +0#af5f00255&|1@1| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
|
||||
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|
||||
|[+1&&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @44
|
||||
| +0&&@59
|
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_2.dump
Normal file
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_2.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
> +0&#ffffff0@59
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+3#0000000&|N|o| |N|a|m|e|]| @50
|
||||
| +0#af5f00255&@1|1| | +0#0000000&@55
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+1#0000000&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @44
|
||||
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|[|]|,| |'|r|'|)| @35
|
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_3.dump
Normal file
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_3.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
> +0&#ffffff0@59
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+3#0000000&|N|o| |N|a|m|e|]| @50
|
||||
| +0#af5f00255&@1|1| ||+0#0000000#ffff4012@1| |f|o@1| @49
|
||||
| +0#af5f00255#ffffff0@1|2| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
|
||||
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|
||||
| +0#af5f00255&@1|3| ||+0#0000000&@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
|
||||
| +0#af5f00255&@3|2+0#0000000&|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| @29
|
||||
|[+1&&|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @44
|
||||
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|,| |'|r|'|)| @34
|
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_4.dump
Normal file
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_4.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
> +0&#ffffff0@59
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+3#0000000&|N|o| |N|a|m|e|]| @50
|
||||
| +0#af5f00255&@1|1| ||+0#0000000#ffff4012@1| |0| |1| |2| |3| |4| |5| |6| |7| |8| |9| |1|0| |1@1| |1|2| |1|3| |1|4| |1|5| |1|6| |1|7| |1|8| |1|9| |2|0|
|
||||
| +0#af5f00255#ffffff0@3|2+0#0000000#ffff4012|1| |2@1| |2|3| |2|4| |2|5| |2|6| |2|7| |2|8| |2|9| |3|0| |3|1| |3|2| |3@1| |3|4| |3|5| |3|6| |3|7| |3|8| |3|9
|
||||
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|4|0| |4|1| |4|2| |4|3| |4@1| |4|5| |4|6| |4|7| |4|8| |4|9| |5|0| |5|1| |5|2| |5|3| |5|4| |5@1| |5|6| |5|7| |5
|
||||
| +0#af5f00255#ffffff0@3|8+0#0000000#ffff4012| |5|9| |6|0| |6|1| |6|2| |6|3| |6|4| |6|5| |6@1| |6|7| |6|8| |6|9| |7|0| |7|1| |7|2| |7|3| |7|4| |7|5| |7|6|
|
||||
| +0#af5f00255#ffffff0@3|7+0#0000000#ffff4012@1| |7|8| |7|9| |8|0| |8|1| |8|2| |8|3| |8|4| |8|5| |8|6| |8|7| |8@1| |8|9| |9|0| |9|1| |9|2| |9|3| |9|4| |9|5
|
||||
|[+1&#ffffff0|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @44
|
||||
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|1|,| |'|r|'|)| @33
|
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_5.dump
Normal file
20
src/testdir/dumps/Test_smoothscroll_in_qf_window_5.dump
Normal file
@@ -0,0 +1,20 @@
|
||||
> +0&#ffffff0@59
|
||||
|~+0#4040ff13&| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|~| @58
|
||||
|[+3#0000000&|N|o| |N|a|m|e|]| @50
|
||||
|<+0#4040ff13&@2| +0#af5f00255&| +0#0000000#ffff4012|9|3|7| |9|3|8| |9|3|9| |9|4|0| |9|4|1| |9|4|2| |9|4|3| |9|4@1| |9|4|5| |9|4|6| |9|4|7| |9|4|8| |9|4|9| |9|5|0
|
||||
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|5|1| |9|5|2| |9|5|3| |9|5|4| |9|5@1| |9|5|6| |9|5|7| |9|5|8| |9|5|9| |9|6|0| |9|6|1| |9|6|2| |9|6|3| |9|6|4
|
||||
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|6|5| |9|6@1| |9|6|7| |9|6|8| |9|6|9| |9|7|0| |9|7|1| |9|7|2| |9|7|3| |9|7|4| |9|7|5| |9|7|6| |9|7@1| |9|7|8
|
||||
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9|7|9| |9|8|0| |9|8|1| |9|8|2| |9|8|3| |9|8|4| |9|8|5| |9|8|6| |9|8|7| |9|8@1| |9|8|9| |9@1|0| |9@1|1| |9@1|2
|
||||
| +0#af5f00255#ffffff0@3| +0#0000000#ffff4012|9@1|3| |9@1|4| |9@1|5| |9@1|6| |9@1|7| |9@1|8| |9@2| @27
|
||||
|[+1&#ffffff0|Q|u|i|c|k|f|i|x| |L|i|s|t|]| @44
|
||||
|:+0&&|c|a|l@1| |s|e|t|q|f|l|i|s|t|(|g|:|l|1|,| |'|r|'|)| @33
|
@@ -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
|
||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
397,
|
||||
/**/
|
||||
396,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user