diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-28 12:36:11 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:47 +0200 |
commit | 6fd7e3bea4c38e79c77fe506a45781ffd17ebe4f (patch) | |
tree | 00b5057d9e3fe69f8cd235882b266a2da22624c3 /src/nvim | |
parent | c25fd85c2e618535b7780b965a883cb20ab1aa1a (diff) | |
download | rneovim-6fd7e3bea4c38e79c77fe506a45781ffd17ebe4f.tar.gz rneovim-6fd7e3bea4c38e79c77fe506a45781ffd17ebe4f.tar.bz2 rneovim-6fd7e3bea4c38e79c77fe506a45781ffd17ebe4f.zip |
vim-patch:9.0.1000: with 'smoothscroll' skipcol may be reset unnecessarily
Problem: With 'smoothscroll' skipcol may be reset unnecessarily.
Solution: Check the line does actually fit in the window.
https://github.com/vim/vim/commit/b21b8e9ed081a6ef6b6745fe65d219b3ac046c3b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/move.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 2bae811e6d..a6c87b641a 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1465,7 +1465,10 @@ void adjust_skipcol(void) bool scrolled = false; validate_cheight(); - if (curwin->w_cline_height == curwin->w_height) { + if (curwin->w_cline_height == curwin->w_height + // w_cline_height may be capped at w_height, check there aren't + // actually more lines. + && plines_win(curwin, curwin->w_cursor.lnum, false) <= curwin->w_height) { // the line just fits in the window, don't scroll reset_skipcol(curwin); return; |