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)

15d4747ffd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-06-06 07:13:08 +08:00
committed by GitHub
parent 30e9ddfd05
commit 9deef1aa22
3 changed files with 40 additions and 4 deletions

View File

@@ -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