-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Describe the bug
When semantic highlighting is used, ST's search highlight is mostly hidden for hits within semantic tokens.
To Reproduce
Steps to reproduce the behavior:
- Open Sublime Text in safe mode
- Install Package Control
- Upgrade Package Control to version 4
- Install LSP
- Install lsp-clangd (or some other LSP plugin capable of semantic highligting (haven't tested with others))
- Configure semantic highlighting for LSP
- In a file where LSP is active, search for strings that appear within semantic tokens
LSP.sublime-settings:
{
"semantic_highlighting": true
}
The color for highlight
is set so that hard-to-see highlights stand out better.
Mariana.sublime-color-scheme:
{
"variables":
{
},
"globals":
{
"highlight": "#00FF00"
},
"rules":
[
{
"scope": "meta.semantic-token",
"background": "#00000101"
}
]
}
Example file with many sorts of occurrences of missing highlights when searching for "q":
void reproduce()
{
// A semantic token gets a very faint highlight when searching.
auto qqqq = "qqqqqqqq";
// Error markings are drawn nicely.
auto qqqqq qqqqqq;
// Even-numbered rows.
int qqqqqq;
int qqqqqqq;
// Odd-numbered rows. On some font sizes, the tops and bottoms are gone.
int qqqqqqqq;
int qqqqqqqqq;
int i_hide_highlights_under_my_background;
int qqqqqqqqqq;
int i_hide_them_too;
// qqqqqqqqqqqqq Comment highlights don't bother each other.
// qqqqqqqqqqqqq But semantic tokens do bother comments.
int qqqqqqqqqqq;
// qqqqqqqqqqqqq
// Highlight for selected text works.
auto qq = 1;
qq = 2;
qq = 3;
qq = 4;
}
Expected behavior
Search hits are highlighted very visibly, with surrounding, unbroken rounded rectangles, as shown in the image below.
In this screenshot, LSP's semantic highlighting is disabled.
Screenshots
Search highlights are buggy.
Highlights for selected text occurrences work fine.
The bug doesn't seem to depend on the theme used. Monokai and others suffer from it too.
With display scale 100%, the partial highlights disappear completely. Font size 48 is used to bring up details.
Environment
- OS: Windows 11 version 23H2 (OS Build 22631.3593)
- Display scale 150%
- Sublime Text version: 4180
- LSP version: 2.2.0
- Language servers used: Clangd 18.1.8, used through LSP-clangd 1.7.0
Additional context
This is likely related to #1934.