This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
[Feature] Use a function to selectively update highlights #338
Labels
kind: feature
New feature or request
Is your feature request related to a problem? Please describe.
Right now, providers can be updated when a function returns
true
or when an autocmd is triggered, buthl
functions are run every single iteration the statusline is drawn. I think it would be great for performance to only run the highlight functions when the provider is updated.Describe the solution you'd like
Use the
provider.update
field to also decide when thehl
function should be called. Since the field now affect an element in an parent context, it should be moved to the component table, which would most probably start an architectural refactor that would also let the user define a local function provider with an update strategy. It's a big update, but I would personally love it.Describe alternatives you've considered
An
hl.update
field could also be used, but sincehl
is already a table, checking the fields could be more cumbersome both for the maintainers and the users.Additional context
I don't have time right now because I'm in the middle of my uni exams, but I can write a PR in the close future. I'm reporting it first just in case the solution is not welcome and no one's time is wasted :p
The text was updated successfully, but these errors were encountered: