aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-06 07:13:08 +0800
committerGitHub <noreply@github.com>2023-06-06 07:13:08 +0800
commit9deef1aa227717a2c73ab1d4ad2c883d9b3c2f24 (patch)
treec40522c2f9b7beaa136af664c643cd8b6ee123e5 /src
parent30e9ddfd05f5f2fa56d7fd5235a3f993b94f9910 (diff)
downloadrneovim-9deef1aa227717a2c73ab1d4ad2c883d9b3c2f24.tar.gz
rneovim-9deef1aa227717a2c73ab1d4ad2c883d9b3c2f24.tar.bz2
rneovim-9deef1aa227717a2c73ab1d4ad2c883d9b3c2f24.zip
vim-patch:9.0.1612: "skipcol" not reset when using multi-byte characters (#23928)
Problem: "skipcol" not reset when using multi-byte characters. Solution: Compare with w_virtcol instead of w_cursor.col. (closes vim/vim#12457) https://github.com/vim/vim/commit/15d4747ffd197ffa5b5a41a852a1fe93b6cc35fd Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/move.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 5934ad90e9..f859294d65 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1826,10 +1826,13 @@ void scroll_cursor_top(int min_scroll, int always)
}
}
check_topfill(curwin, false);
- // TODO(vim): if the line doesn't fit may optimize w_skipcol
- if (curwin->w_topline == curwin->w_cursor.lnum
- && curwin->w_skipcol >= curwin->w_cursor.col) {
- reset_skipcol(curwin);
+ if (curwin->w_topline == curwin->w_cursor.lnum) {
+ validate_virtcol();
+ if (curwin->w_skipcol >= curwin->w_virtcol) {
+ // TODO(vim): if the line doesn't fit may optimize w_skipcol instead
+ // of making it zero
+ reset_skipcol(curwin);
+ }
}
if (curwin->w_topline != old_topline
|| curwin->w_skipcol != old_skipcol