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

need more performant ways of setting colors in cases of frequent updates #210

Open
ExpandingMan opened this issue Aug 13, 2021 · 0 comments

Comments

@ExpandingMan
Copy link

I've been running into an issue where I am trying to change the color of a galaxyline element depending on whether my buffer is modified. This has turned out to be surprisingly challenging apparently because calling highlight is incredibly inefficient, and the check seems to be running all the time. In my case, there don't seem to be any good alternatives. I tried instead having it swap between two different galaxyline elements, but it doesn't seem to call the condition often enough for this to work. In some case a user may be able to hack around this by using a global "switch", but that is pretty complicated in this case and probably many others since the state isn't quite global, it is per buffer. I deemed fixing this to not be worth it and decided I'll have to live with an element that doesn't change color.

I don't think there is a simple fix here, but in general it seems that relying on highlight to set colors can lead to significant performance issues if this is done with any frequency. Printing using console codes might work, but I don't know how this will interact with the existing highlight groups.

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

No branches or pull requests

1 participant