Skip to content
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

Open
Groctel opened this issue Jan 15, 2023 · 0 comments
Open

[Feature] Use a function to selectively update highlights #338

Groctel opened this issue Jan 15, 2023 · 0 comments
Labels
kind: feature New feature or request

Comments

@Groctel
Copy link

Groctel commented Jan 15, 2023

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, but hl 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 the hl 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 since hl 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

@Groctel Groctel added the kind: feature New feature or request label Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant