mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
vim-patch:9.1.0176: Cursor column wrong with 'virtualedit' and conceal
Problem: Cursor column wrong with 'virtualedit' and conceal.
Solution: Correct cursor column at end of line if never reached.
(zeertzjq)
closes: vim/vim#14190
253ff4dece
This commit is contained in:
@@ -2451,11 +2451,17 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
|
||||
|
||||
// In the cursor line and we may be concealing characters: correct
|
||||
// the cursor column when we reach its position.
|
||||
// With 'virtualedit' we may never reach cursor position, but we still
|
||||
// need to correct the cursor column, so do that at end of line.
|
||||
if (!did_wcol
|
||||
&& wp == curwin && lnum == wp->w_cursor.lnum
|
||||
&& conceal_cursor_line(wp)
|
||||
&& (int)wp->w_virtcol <= wlv.vcol + wlv.skip_cells) {
|
||||
&& (wlv.vcol + wlv.skip_cells >= wp->w_virtcol || mb_schar == NUL)) {
|
||||
wp->w_wcol = wlv.col - wlv.boguscols;
|
||||
if (wlv.vcol + wlv.skip_cells < wp->w_virtcol) {
|
||||
// Cursor beyond end of the line with 'virtualedit'.
|
||||
wp->w_wcol += wp->w_virtcol - wlv.vcol - wlv.skip_cells;
|
||||
}
|
||||
wp->w_wrow = wlv.row;
|
||||
did_wcol = true;
|
||||
wp->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
|
||||
|
Reference in New Issue
Block a user