-
-
Notifications
You must be signed in to change notification settings - Fork 123
Description
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.