diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-10 21:10:12 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-10 21:10:12 +0100 |
commit | 8f33ebfade10cd1b4296d8ec8dca815a09e8a405 (patch) | |
tree | 14c69ab4de9f7311ac0d09bf9898a982bdc91e48 /src/move.c | |
parent | 3ff656f6b43465083b58e1d2fb9b8008abc5bc17 (diff) | |
download | vim-git-8f33ebfade10cd1b4296d8ec8dca815a09e8a405.tar.gz |
patch 8.2.2495: text jumps up and down when moving the cursorv8.2.2495
Problem: Text jumps up and down when moving the cursor in a small window
with wrapping text and 'scrolloff' set.
Solution: Adjust the computation of w_skipcol. (partly by Ghjuvan Lacambre,
closes #7813)
Diffstat (limited to 'src/move.c')
-rw-r--r-- | src/move.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/move.c b/src/move.c index aa90b528a..d90e4d2d9 100644 --- a/src/move.c +++ b/src/move.c @@ -1125,10 +1125,10 @@ curs_columns( n = curwin->w_wrow + so; else n = p_lines; - if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width) + if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width - so) extra += 2; - if (extra == 3 || p_lines < so * 2) + if (extra == 3 || p_lines <= so * 2) { // not enough room for 'scrolloff', put cursor in the middle n = curwin->w_virtcol / width; |