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

Initialize colors correctly if virtual text is loaded first #3960

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

vimpostor
Copy link
Contributor

See commit message for more details.

Do we need a test for this?

@vimpostor vimpostor force-pushed the virt_set_highlights branch 2 times, most recently from 199dc22 to 67c3b8c Compare October 31, 2021 23:52
@vimpostor
Copy link
Contributor Author

I have added a test now, that fails without this patch and passes after applying this patch.

If virtualtext.vim is autoloaded first, it will link
ALEVirtualTextWarning to ALEWarning. But ALEWarning is not initialized
yet, so it will create ALEWarning, but with no color definition set.

Shortly after, highlight.vim is autoloaded, which would usually link
ALEWarning to SpellCap, but only if ALEWarning is not already set.
However since ALEWarning is already initialized due to the previous
link, we skip this and never actually come around to properly
initializing it.

We fix this by initializing all highlight groups in highlight.vim, thus
satisfying the dependency of ALEVirtualTextWarning being initialized
after ALEWarning.

Fixes dense-analysis#3585
Copy link
Contributor

@hsanson hsanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, thanks for the fix.

@hsanson hsanson merged commit 9860dad into dense-analysis:master Dec 9, 2021
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.

None yet

2 participants