Open kuro337 opened 1 month ago
Trying something along these lines
function M.disable_lualine_autocommands()
-- Clear autocommands for Lualine's groups
vim.cmd([[
augroup lualine_stl_refresh
autocmd! BufWritePost,BufEnter
augroup END
augroup lualine_tal_refresh
autocmd! BufWritePost,BufEnter
augroup END
augroup lualine_wb_refresh
autocmd! BufWritePost,BufEnter
augroup END
]])
end
But doesn't have to have the desired effect as well - I see these are hardcoded that might be causing the issues?
-- The events on which lualine redraws itself
local default_refresh_events =
'WinEnter,BufEnter,BufWritePost,SessionLoadPost,FileChangedShellPost,VimResized,Filetype,CursorMoved,CursorMovedI,ModeChanged'
Also is this expected?
I am seeing this -
M.get_hl_diff call rate: 460.00 calls/minute (Total calls: 92, Elapsed time: 0.20 minutes)
M.get_hl_diff call rate: 1191.43 calls/minute (Total calls: 556, Elapsed time: 0.47 minutes)
M.get_hl_diff call rate: 1632.00 calls/minute (Total calls: 1904, Elapsed time: 1.17 minutes)
Every single function in the config is called this frequently?
For people with the diff component for e.g won't that be the plugin makes a git syscall on the filesystem with such high frequency?
Not sure if I am missing any settings or if this is expected - for me currently there seem to be a lot of redundant calls in excess
It mentions it is not guaranteed but does it not work at all in terms of not applying refreshes?
By it's not guaranteed it means that it can refresh more often based on other factors other than the refresh rate. Basically it'll refresh atleast as often as user-specified refresh rate.
But doesn't have to have the desired effect as well
are you sure you can remove an event from a autocommand like that? I don't think that's a thing. if you want to clear you'd have to clear all of them.
augroup lualine_stl_refresh
autocmd!
augroup END
Also BufEnter and BufWritePost doesn't get triggered very often. And are quite handy for statusline. I feel like getting triggered by events is better than a refreshrate.
Every single function in the config is called this frequently?
That rate does look suspiciously high. Can you tell me how did you record it?
Also, where is this get_hl_diff ? I'm getting 0 hits with grep.
For people with the diff component for e.g won't that be the plugin makes a git syscall on the filesystem with such high frequency?
The internal diff caches it's result and doesn't actually hit filesystem as too often even if refresh rate is high.
I see the refresh settings are documented here -
It mentions it is not guaranteed but does it not work at all in terms of not applying refreshes?
I want to control the refresh behavior myself so ideally I can disable it - would appreciate any feedback
But the setting seems to have no effect