You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 callinghighlight
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 thecondition
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.The text was updated successfully, but these errors were encountered: