-
I'm trying to understand how update works. As I'm understanding now, without any conditions/update set if I have an Example: local ViMode = {
init = function(self)
self.bruh = vim.loop.gettimeofday()
end,
provider = function(self)
return vim.loop.gettimeofday()
end,
update = false,
}
local SL_Left = {
ViMode,
}
require("heirline").setup({
statusline = {
SL_Left,
},
}) Note: This example is just to try and understand how the options work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
by default the statusline is redrawn whenever neovim thinks it is most appropriate (redraw conditions are not really documented). At each redraw fired by neovim, the entire statusline is re-evaluated. This might be inefficient for some components that need to do some heavy tasks but don't need to be re-evaluated often, maybe only when directory is changed, buffer is saved, etc. the |
Beta Was this translation helpful? Give feedback.
by default the statusline is redrawn whenever neovim thinks it is most appropriate (redraw conditions are not really documented). At each redraw fired by neovim, the entire statusline is re-evaluated. This might be inefficient for some components that need to do some heavy tasks but don't need to be re-evaluated often, maybe only when directory is changed, buffer is saved, etc. the
update
field allows to control on which events the component will be re-evaluated, instead of using its cached value.condition
, but notinit
, is always evaluated, regardless. Settingupdate = false
indeed is not doing what you think it should be doing, it is just saying that you don't want to specify what even…