-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Custom refresh rate per component #1184
Comments
To anyone looking for a stop-gap, it's possible to control when the component updates See lualine.nvim/lua/lualine/components/buffers/init.lua Lines 205 to 219 in 0a5a668
You can't control the refresh rate, maybe, but you can tell the component to reuse a previous computation and only compute in limited situations. e.g. something like function M:draw()
if not self._needs_refresh then
return self.status
end
local status = self:update_status()
self._needs_refresh = false
if status then
status = " " .. status .. " "
end
self.status = status
return self.status
end
Ideally though I'd like a directly tell lualine to refresh from within the component so that lualine updates immediately. As it is, my code is ready immediately but there's still a delay from when the code runs |
Actually I think you can refresh lualine with |
Hiya @ColinKennedy thank you for your comment. The issue atm is that the same refresh rate is used for all components. I know you can manually cache the draw response, which is something I've done. But its still not really ideal. I am also indeed aware that the refresh function exists, but afaik that would not in any way shape, or form resolve this. As a matter a fact it would just make the issue even worse as it would update even more frequently if you use that. Please feel free to correct me if I'm incorrect, as I haven't used this plugin since the post of this issue. |
My suggestions weren't in direct response to your question about altering the refresh rate, just some strategies in case others looking for similar things can do without. That's why I called it it a stop-gap. FWIW if your needs is to refresh slower than normal then you could use a uv timer + custom draw to achieve. Buf if you need faster than normal refreshing I'm not sure how that'd be achievable. |
Requested feature
It would be nice to either have a custom refresh rate for specifically defined components
Or, have a way to disable refreshing for a component and require manually calling the lualine refresh function
Motivation
Some tasks are more intensive then others, and therefore might not want to be ran as often as everything else
The text was updated successfully, but these errors were encountered: