[vim/vim] highlight: wrong column highlighted with 'cursorcolumn' (PR #20902)

3 views
Skip to first unread message

h_east

unread,
5:08 PM (5 hours ago) 5:08 PM
to vim/vim, Subscribed
Problem:  With 'virtualedit' set to "all" and 'cursorcolumn' set, the wrong
          column may be highlighted after a command that moved the cursor
          into virtual space and back.
Solution: Make sure the virtual column is up to date before drawing the
          window.

fixes: #2576


set virtualedit=all
set cursorcolumn
call setline(1, ['', '', ''])
call cursor(3, 1)

Pressing <Del> highlights the second column while the cursor is in the
first one.

"x" is translated to "dl", and with 'virtualedit' the "l" succeeds on an
empty line, so coladvance() sets w_virtcol for the virtual position. When
the operator puts the cursor back, do_pending_operator() resets
VALID_VIRTCOL, but the old value stays in w_virtcol and nothing computes it
again: only the ruler validates it, in win_redr_ruler().

This was in todo.txt, the entry is removed.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20902

Commit Summary

  • 76f9bb6 highlight: wrong column highlighted with 'cursorcolumn'

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20902@github.com>

Reply all
Reply to author
Forward
0 new messages