Mercurial > vim
comparison src/normal.c @ 24731:a6a4224902f5 v8.2.2904
patch 8.2.2904: "g$" causes scroll if half a double width char is visible
Commit: https://github.com/vim/vim/commit/74ede80aeb272ac81d41a256057c4f250372dd00
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 29 19:18:01 2021 +0200
patch 8.2.2904: "g$" causes scroll if half a double width char is visible
Problem: "g$" causes scroll if half a double width char is visible.
Solution: Advance to the last fully visible character. (closes https://github.com/vim/vim/issues/8254)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 29 May 2021 19:30:03 +0200 |
parents | b7f58be68c02 |
children | 1ce39e257f1b |
comparison
equal
deleted
inserted
replaced
24730:0cc7f1a2af5c | 24731:a6a4224902f5 |
---|---|
6142 (void)cursor_down(cap->count1 - 1, FALSE); | 6142 (void)cursor_down(cap->count1 - 1, FALSE); |
6143 | 6143 |
6144 i = curwin->w_leftcol + curwin->w_width - col_off - 1; | 6144 i = curwin->w_leftcol + curwin->w_width - col_off - 1; |
6145 coladvance((colnr_T)i); | 6145 coladvance((colnr_T)i); |
6146 | 6146 |
6147 // if the character doesn't fit move one back | |
6148 if (curwin->w_cursor.col > 0 | |
6149 && (*mb_ptr2cells)(ml_get_cursor()) > 1) | |
6150 { | |
6151 colnr_T vcol; | |
6152 | |
6153 getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &vcol); | |
6154 if (vcol >= curwin->w_leftcol + curwin->w_width - col_off) | |
6155 --curwin->w_cursor.col; | |
6156 } | |
6157 | |
6147 // Make sure we stick in this column. | 6158 // Make sure we stick in this column. |
6148 validate_virtcol(); | 6159 validate_virtcol(); |
6149 curwin->w_curswant = curwin->w_virtcol; | 6160 curwin->w_curswant = curwin->w_virtcol; |
6150 curwin->w_set_curswant = FALSE; | 6161 curwin->w_set_curswant = FALSE; |
6151 } | 6162 } |