Mercurial > vim
comparison src/move.c @ 33017:7d0357f70cf8 v9.0.1800
patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Commit: https://github.com/vim/vim/commit/6a3897232aecd3e8b9e8b23955e55c1993e5baec
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Aug 27 19:04:14 2023 +0200
patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem: Cursor position still wrong with 'showbreak' and virtual text
after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
fix first char of virtual text not shown at the start of a screen
line.
closes: #12478
closes: #12532
closes: #12904
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 27 Aug 2023 19:15:05 +0200 |
parents | 75c283beb74f |
children | 18f4a04384f3 |
comparison
equal
deleted
inserted
replaced
33016:0af63fa799bf | 33017:7d0357f70cf8 |
---|---|
1203 { | 1203 { |
1204 // this same formula is used in validate_cursor_col() | 1204 // this same formula is used in validate_cursor_col() |
1205 n = (curwin->w_wcol - curwin->w_width) / width2 + 1; | 1205 n = (curwin->w_wcol - curwin->w_width) / width2 + 1; |
1206 curwin->w_wcol -= n * width2; | 1206 curwin->w_wcol -= n * width2; |
1207 curwin->w_wrow += n; | 1207 curwin->w_wrow += n; |
1208 | |
1209 #ifdef FEAT_LINEBREAK | |
1210 // When cursor wraps to first char of next line in Insert | |
1211 // mode, the 'showbreak' string isn't shown, backup to first | |
1212 // column | |
1213 char_u *sbr = get_showbreak_value(curwin); | |
1214 if (*sbr && *ml_get_cursor() == NUL | |
1215 && curwin->w_wcol | |
1216 == (curwin->w_width - width2) + vim_strsize(sbr)) | |
1217 curwin->w_wcol = 0; | |
1218 #endif | |
1219 } | 1208 } |
1220 } | 1209 } |
1221 | 1210 |
1222 // No line wrapping: compute curwin->w_leftcol if scrolling is on and line | 1211 // No line wrapping: compute curwin->w_leftcol if scrolling is on and line |
1223 // is not folded. | 1212 // is not folded. |