Patch 9.0.1610
Problem: Display is wrong when 'smoothscroll' is set and scrolling multiple
lines.
Solution: Redraw with UPD_NOT_VALID when "skipcol" is or was set.
(closes #12490, closes #12468)
Files: src/move.c, src/testdir/test_scroll_opt.vim,
src/testdir/dumps/Test_smooth_multi_skipcol_1.dump,
src/testdir/dumps/Test_smooth_multi_skipcol_2.dump,
src/testdir/dumps/Test_smooth_multi_skipcol_3.dump
*** ../vim-9.0.1609/src/move.c 2023-06-04 19:29:18.632643893 +0100
--- src/move.c 2023-06-05 18:38:39.129392959 +0100
***************
*** 1786,1792 ****
int width1 = curwin->w_width - curwin_col_off();
int width2 = width1 + curwin_col_off2();
int size = 0;
- linenr_T prev_topline = curwin->w_topline;
colnr_T prev_skipcol = curwin->w_skipcol;
if (do_sms)
--- 1786,1791 ----
***************
*** 1850,1859 ****
}
}
! // TODO: is comparing w_topline with prev_topline still needed?
! if (curwin->w_topline == prev_topline
! || curwin->w_skipcol != prev_skipcol)
! // need to redraw because wl_size of the topline may now be invalid
redraw_later(UPD_NOT_VALID);
}
else
--- 1849,1857 ----
}
}
! if (prev_skipcol > 0 || curwin->w_skipcol > 0)
! // need to redraw more, because wl_size of the (new) topline may
! // now be invalid
redraw_later(UPD_NOT_VALID);
}
else
*** ../vim-9.0.1609/src/testdir/test_scroll_opt.vim 2023-06-03
22:08:11.526360596 +0100
--- src/testdir/test_scroll_opt.vim 2023-06-05 18:33:30.848795225 +0100
***************
*** 798,807 ****
let lines =<< trim END
setlocal cursorline scrolloff=0 smoothscroll
! call setline(1, repeat([''], 9))
call setline(3, repeat('a', 50))
! call setline(8, 'bbb')
! call setline(9, 'ccc')
redraw
END
call writefile(lines, 'XSmoothMultiSkipcol', 'D')
--- 798,808 ----
let lines =<< trim END
setlocal cursorline scrolloff=0 smoothscroll
! call setline(1, repeat([''], 8))
call setline(3, repeat('a', 50))
! call setline(4, repeat('a', 50))
! call setline(7, 'bbb')
! call setline(8, 'ccc')
redraw
END
call writefile(lines, 'XSmoothMultiSkipcol', 'D')
***************
*** 811,816 ****
--- 812,820 ----
call term_sendkeys(buf, "3\<C-E>")
call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_2', {})
+ call term_sendkeys(buf, "2\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_3', {})
+
call StopVimInTerminal(buf)
endfunc
*** ../vim-9.0.1609/src/testdir/dumps/Test_smooth_multi_skipcol_1.dump
2023-06-03 22:08:11.526360596 +0100
--- src/testdir/dumps/Test_smooth_multi_skipcol_1.dump 2023-06-05
18:33:30.848795225 +0100
***************
*** 2,9 ****
| +0&&@39
|a@39
@10| @29
! @40
! @40
@40
@40
|b@2| @36
--- 2,9 ----
| +0&&@39
|a@39
@10| @29
! |a@39
! @10| @29
@40
@40
|b@2| @36
*** ../vim-9.0.1609/src/testdir/dumps/Test_smooth_multi_skipcol_2.dump
2023-06-03 22:08:11.526360596 +0100
--- src/testdir/dumps/Test_smooth_multi_skipcol_2.dump 2023-06-05
18:33:30.848795225 +0100
***************
*** 1,6 ****
|<+0#4040ff13#ffffff0@2|a+8#0000000&@5>a| @29
! | +0&&@39
! @40
@40
@40
|b@2| @36
--- 1,6 ----
|<+0#4040ff13#ffffff0@2|a+8#0000000&@5>a| @29
! |a+0&&@39
! @10| @29
@40
@40
|b@2| @36
*** ../vim-9.0.1609/src/testdir/dumps/Test_smooth_multi_skipcol_3.dump
2023-06-05 18:41:00.881609065 +0100
--- src/testdir/dumps/Test_smooth_multi_skipcol_3.dump 2023-06-05
18:33:30.848795225 +0100
***************
*** 0 ****
--- 1,10 ----
+ |<+0#4040ff13#ffffff0@2|a+8#0000000&@5>a| @29
+ | +0&&@39
+ @40
+ |b@2| @36
+ |c@2| @36
+ |~+0#4040ff13&| @38
+ |~| @38
+ |~| @38
+ |~| @38
+ | +0#0000000&@21|4|,|5|0| @9|B|o|t|
*** ../vim-9.0.1609/src/version.c 2023-06-05 16:53:20.817489906 +0100
--- src/version.c 2023-06-05 18:36:37.793182231 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1610,
/**/
--
hundred-and-one symptoms of being an internet addict:
119. You are reading a book and look for the scroll bar to get to
the next page.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230605174222.46FFF1C0542%40moolenaar.net.