Mercurial > vim
diff src/move.c @ 32561:f8eca24e58d6
patch 9.0.1612: "skipcol" not reset when using multi-byte characters
Commit: https://github.com/vim/vim/commit/15d4747ffd197ffa5b5a41a852a1fe93b6cc35fd
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 5 20:44:55 2023 +0100
patch 9.0.1612: "skipcol" not reset when using multi-byte characters
Problem: "skipcol" not reset when using multi-byte characters.
Solution: Compare with w_virtcol instead of w_cursor.col. (closes https://github.com/vim/vim/issues/12457)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Jun 2023 21:45:04 +0200 |
parents | e64d1fd43178 |
children | 23e24f3cae03 |
line wrap: on
line diff
--- a/src/move.c +++ b/src/move.c @@ -2414,10 +2414,14 @@ scroll_cursor_top(int min_scroll, int al } check_topfill(curwin, FALSE); #endif - // TODO: 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(); + if (curwin->w_topline == curwin->w_cursor.lnum) + { + validate_virtcol(); + if (curwin->w_skipcol >= curwin->w_virtcol) + // TODO: if the line doesn't fit may optimize w_skipcol instead + // of making it zero + reset_skipcol(); + } if (curwin->w_topline != old_topline || curwin->w_skipcol != old_skipcol #ifdef FEAT_DIFF