diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-10 18:05:21 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-10 18:07:31 -0500 |
commit | c3dada3e5a6fbf3cf845bdf17c9eaad132b5b841 (patch) | |
tree | 8d3ed1fd530121c7863ee406f6fbb1bdb5ded424 /src/nvim/move.c | |
parent | 89143b5fc430340d542a9d1dff7240359aab8956 (diff) | |
download | rneovim-c3dada3e5a6fbf3cf845bdf17c9eaad132b5b841.tar.gz rneovim-c3dada3e5a6fbf3cf845bdf17c9eaad132b5b841.tar.bz2 rneovim-c3dada3e5a6fbf3cf845bdf17c9eaad132b5b841.zip |
vim-patch:8.2.2495: text jumps up and down when moving the cursor
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 vim/vim#7813)
https://github.com/vim/vim/commit/8f33ebfade10cd1b4296d8ec8dca815a09e8a405
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r-- | src/nvim/move.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index a6afdc27d9..1210a3365a 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -888,11 +888,11 @@ void curs_columns( } else { n = plines; } - if ((colnr_T)n >= wp->w_height_inner + wp->w_skipcol / width) { + if ((colnr_T)n >= wp->w_height_inner + wp->w_skipcol / width - so) { extra += 2; } - if (extra == 3 || plines < so * 2) { + if (extra == 3 || plines <= so * 2) { // not enough room for 'scrolloff', put cursor in the middle n = wp->w_virtcol / width; if (n > wp->w_height_inner / 2) { |