diff options
author | luukvbaal <luukvbaal@gmail.com> | 2023-05-16 01:56:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 07:56:06 +0800 |
commit | 5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f (patch) | |
tree | cb2dc2c09229f952594ef764387fa3433ba42fd1 /src | |
parent | bd247d835fd703c62df2bc0fbe3c8c522cc9c7ac (diff) | |
download | rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.tar.gz rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.tar.bz2 rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.zip |
vim-patch:9.0.1561: display wrong when moving cursor to above the top line (#23644)
Problem: Display wrong when moving cursor to above the top line and
'smoothscroll' is set.
Solution: Call adjust_skipcol() in more places and make it work better.
(Luuk van Baal, closes vim/vim#12395)
https://github.com/vim/vim/commit/798fa76dbf737f855e47b10bf326453866b429ab
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 4 | ||||
-rw-r--r-- | src/nvim/textobject.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 6a6f8149dd..ead2b3b0d3 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1502,11 +1502,11 @@ void adjust_skipcol(void) } else { curwin->w_skipcol -= width1; } - redraw_later(curwin, UPD_NOT_VALID); scrolled = true; - validate_virtcol(); } if (scrolled) { + validate_virtcol(); + redraw_later(curwin, UPD_NOT_VALID); return; // don't scroll in the other direction now } long col = curwin->w_virtcol - curwin->w_skipcol + scrolloff_cols; diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c index 428b14a68d..5036c10827 100644 --- a/src/nvim/textobject.c +++ b/src/nvim/textobject.c @@ -22,6 +22,7 @@ #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/move.h" #include "nvim/normal.h" #include "nvim/option_defs.h" #include "nvim/pos.h" @@ -414,6 +415,7 @@ int bck_word(long count, bool bigword, bool stop) finished: stop = false; } + adjust_skipcol(); return OK; } @@ -518,6 +520,7 @@ int bckend_word(long count, bool bigword, bool eol) } } } + adjust_skipcol(); return OK; } |