Skip to content

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

@ExpandingMan

Description

@ExpandingMan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions