{{ message }}
Ensure VisualNOS is only used under X11; fall back to Visual otherwise.#19659
Closed
shaneharper wants to merge 1 commit intovim:masterfrom
Closed
Conversation
ef13337 to
8bac956
Compare
Member
Problem: Vim could use the VisualNOS highlight group when not connected to an X server. Solution: Always highlight visual selections with Visual when not connected to an X server. When Vim is running with X11 support it chooses between the Visual and VisualNOS highlight groups for a visual selection based on whether it believes it owns the X selection. According to :help hl-VisualNOS, VisualNOS should only be used by the X11 GUI or when using the xterm-clipboard feature, however, prior to this commit Vim could choose VisualNOS when a clipboard provider was used, even when Vim was not connected to an X server.
8bac956 to
e88d119
Compare
Contributor
Author
Done.
I tried |
Member
|
alright, thanks |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem: Vim could use the VisualNOS highlight group when not connected to an X server.
Solution: Always highlight visual selections with Visual when not connected to an X server.
When Vim is running with X11 support it chooses between the Visual and VisualNOS highlight groups for a visual selection based on whether it believes it owns the X selection. According to :help hl-VisualNOS, VisualNOS should only be used by the X11 GUI or when using the xterm-clipboard feature, however, prior to this commit Vim could choose VisualNOS when a clipboard provider was used, even when Vim was not connected to an X server.
I first noticed the issue after running:
:packadd osc52 | set clipmethod=osc52I wrote the following test case. The test is effective if my shell's DISPLAY variable has been unset. I did not work out how to make the test work if the Vim instance running the test had connected to an X server (as then it may then use VisualNOS instead of Visual for highlighting the visual selection).