summaryrefslogtreecommitdiffstats
path: root/src/drawscreen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-03 20:01:16 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-03 20:01:16 +0100
commitb6aab8f44beb8c5d99393abdc2c9faab085c72aa (patch)
treedffa0fca48cf9bb9dce8f2b5f2b32f1d96f642e8 /src/drawscreen.c
parentf269eabc6c4f5bdcef989cd5b4b95ba8ccaa4d8a (diff)
patch 9.0.0652: 'smoothscroll' not tested with 'number' and "n" in 'cpo'v9.0.0652
Problem: 'smoothscroll' not tested with 'number' and "n" in 'cpo'. Solution: Add tests, fix uncovered problem.
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r--src/drawscreen.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 47066995a5..fa5d6683df 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -1552,6 +1552,26 @@ win_update(win_T *wp)
init_search_hl(wp, &screen_search_hl);
#endif
+ // Make sure skipcol is valid, it depends on various options and the window
+ // width.
+ if (wp->w_skipcol > 0)
+ {
+ int w = 0;
+ int width1 = wp->w_width - win_col_off(wp);
+ int width2 = width1 + win_col_off2(wp);
+ int add = width1;
+
+ while (w < wp->w_skipcol)
+ {
+ if (w > 0)
+ add = width2;
+ w += add;
+ }
+ if (w != wp->w_skipcol)
+ // always round down, the higher value may not be valid
+ wp->w_skipcol = w - add;
+ }
+
#ifdef FEAT_LINEBREAK
// Force redraw when width of 'number' or 'relativenumber' column
// changes.