Problem: In a terminal the character under the cursor is normally not shown as part of the visual selection.
Solution: Don't set "noinvcur" in win_line().
The problem did not occur in the GUI, only in a terminal.
The name "noinvcur" ("don't invert the cursor") was misleading: the variable did not affect the cursor, but whether the character under the cursor could be displayed as part of the visual selection.
The "noinvcur" handling may have been meant to help during a visual selection when Visual is shown in reverse video and the terminal draws the cursor by inverting the character under it, as otherwise the character under the cursor would not look highlighted like the rest of the selection. But Vim cannot know in general how a terminal draws the cursor, and when either the cursor is not drawn by inverting the character under it or Visual is not shown in reverse video, the handling just left a character of the visual selection unhighlighted.
Claude Opus 5 suggested deleting the fromcol_prev and vcol_prev variables from win_line(); I wrote all of the code changes.
https://github.com/vim/vim/pull/21317
(53 files)
—
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.![]()
I think the problem here is that highlighting the cursor position may make the cursor invisible.
—
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.![]()
I think the problem here is that highlighting the cursor position may make the cursor invisible.
One case where it might be worse is an underline or bar cursor whose color is the same as (or similar to) Visual's background color.
Even where the cursor isn't distinguishable from the selection, its position is usually easy to follow. In a character-wise selection it's at one end of the selection, and in a line-wise selection its column doesn't affect what's selected. On the other hand, leaving the character under the cursor unhighlighted makes the selection look wrong with many combinations of Visual highlighting and cursor style.
—
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.![]()
Hm, we used to have Visual setting reverse until 59bafc8 (v9.1.0068) when the terminal did not have at least 8 colors. Perhaps that's why this was set initially?
—
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.![]()
Hm, we used to have Visual setting reverse until 59bafc8 (v9.1.0068) when the terminal did not have at least 8 colors. Perhaps that's why this was set initially?
That seems likely - the "noinvcur" code looks like it was written assuming Visual would be shown in reverse video. That code existed in v7.0001 (the start of Vim's git history) when Visual was term=reverse cterm=reverse for every terminal.
On a terminal where Visual is still shown in reverse video, the cursor can usually be told apart from the selection without relying on a different color, e.g. a blinking cursor, or an underline cursor drawn by inverting pixels.
—
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.![]()
alright thanks. I think this is fine
—
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.![]()