Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decorations: prevent interference from other lens extensions #28

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

bmalehorn
Copy link

VSCode has a long-standing bug microsoft/vscode#33852: multiple decorators on the same line are resolved by whichever was inserted last. If you set the color in the decoration type and the contentText in the decoration options, another extension might insert its own style in between, overriding your color.

This PR implements the suggested workaround: set the contentText and color at the same time so they'll always appear together. It does so setting everything in the decoration options, instead of only a sparse contentText.

I tested this out with the GitLens extension, and it seems to work pretty well! Let me know if you need anything changed. It's unfortunate there's no VSCode fix yet, but this PR seems like a reasonable workaround that makes this extension feel less buggy.

Before

image

After

image

Related: #25

VSCode has a long-standing bug
microsoft/vscode#33852: multiple decorators on
the same line are resolved by whichever was inserted *last*. So you set
the **color** in the decoration **type** and the **contentText** in the
decoration **options**, another extension might insert its own style in
between.

This PR implements the suggested workaround: set the `contentText` and
`color` at the same time so they'll always appear together. It does so
setting everything in the decoration **options**, instead of only a
sparse `contentText`.

Related: usernamehw#25
@usernamehw usernamehw merged commit a1fd530 into usernamehw:master Oct 9, 2019
@usernamehw
Copy link
Owner

LGTM. I'll publish once this is tested a bit more.

@bmalehorn bmalehorn deleted the lens-collision branch October 11, 2019 06:42
@usernamehw
Copy link
Owner

usernamehw commented May 16, 2022

The upstream issue was fixed so decoration style and text from different extensions are not merged together like before. Now all :after decorations are rendered on one line (with proper styling).

I'm going to revert this change since it's pretty bad for performance.

usernamehw added a commit that referenced this pull request May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants