diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-27 04:54:50 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:46 +0200 |
commit | f3b44cf23d9c240471826e4f35555ee85ded1e5b (patch) | |
tree | 4ffc9f9a95ae1147f798f4b734a9d1d1d2771de3 /src/nvim/drawscreen.c | |
parent | e9b1df21bc9c051fe46578772c45c5bdadaf1e5c (diff) | |
download | rneovim-f3b44cf23d9c240471826e4f35555ee85ded1e5b.tar.gz rneovim-f3b44cf23d9c240471826e4f35555ee85ded1e5b.tar.bz2 rneovim-f3b44cf23d9c240471826e4f35555ee85ded1e5b.zip |
vim-patch:9.0.0652: 'smoothscroll' not tested with 'number' and "n" in 'cpo'
Problem: 'smoothscroll' not tested with 'number' and "n" in 'cpo'.
Solution: Add tests, fix uncovered problem.
https://github.com/vim/vim/commit/b6aab8f44beb8c5d99393abdc2c9faab085c72aa
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r-- | src/nvim/drawscreen.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index b5e516005b..36ff53aacb 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -1447,6 +1447,26 @@ static void win_update(win_T *wp, DecorProviders *providers) init_search_hl(wp, &screen_search_hl); + // 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; + } + } + // Force redraw when width of 'number' or 'relativenumber' column // changes. int nrwidth = (wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc) ? number_width(wp) : 0; |