Skip to content

Commit 4d8acfd

Browse files
committed
Subscribe to all statusline OptionSet events
This isn't really necessary for any sane statusline. But of course this is a world where lualine exists. Lualine is using a cursed timer-based update [0], where they update the statusline option directly instead of using a function indirection like literally every single sane statusline plugin in existance. As I have explained several times in the past, this introduces many problems, even for vanilla lualine users without any other plugin involved (e.g. some statusline updates will not trigger lualine's timer-based update, so even vanilla lualine may sometimes have a slight lag). This is now the third time that lualine's inability to follow basic vim idiomatic patterns has caused us painful regressions [1]. In this case the regression occurred because there seems to be an autocmd order conflict, which causes tpipeline to miss the most recent statusline update and lag behind exactly one iteration. Lualine should just switch back to the sane function indirection pattern, but these days a majority of neovim plugin devs seem to be completely immune to following vim best practices... Fixes #50 [0] nvim-lualine/lualine.nvim#736 [1] See commit affe9ca
1 parent 382e33f commit 4d8acfd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoload/tpipeline.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ func tpipeline#build_hooks()
3232
au CursorMoved * call tpipeline#update()
3333
endif
3434

35-
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline && g:tpipeline_clearstl
36-
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | call tpipeline#update() | endif
35+
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline
36+
if g:tpipeline_clearstl
37+
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | endif
38+
endif
39+
au OptionSet statusline call tpipeline#update()
3740
endif
3841
augroup END
3942
endfunc

0 commit comments

Comments
 (0)