Skip to content

Commit 4890739

Browse files
committed
Revert "Refactor statusline OptionSet into function"
This reverts commit 6142ad2. It actually made it harder to understand what's going on due to the augroup scope.
1 parent 8cc0de6 commit 4890739

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

autoload/tpipeline.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ func tpipeline#build_hooks()
3232
au CursorMoved * call tpipeline#update()
3333
endif
3434

35-
call tpipeline#util#set_stl_hooks()
35+
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline
36+
if g:tpipeline_clearstl
37+
if tpipeline#util#is_lualine()
38+
au OptionSet statusline call tpipeline#util#clear_stl()
39+
else
40+
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | endif
41+
endif
42+
endif
43+
au OptionSet statusline call tpipeline#update()
44+
endif
3645
augroup END
3746
endfunc
3847

autoload/tpipeline/util.vim

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,3 @@ func tpipeline#util#is_lualine()
3434
" lualine doesn't play nice, so it needs extra workarounds
3535
return has('nvim') && !empty(nvim_get_autocmds(#{group: "lualine"}))
3636
endfunc
37-
38-
func tpipeline#util#set_stl_hooks()
39-
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline
40-
if g:tpipeline_clearstl
41-
if tpipeline#util#is_lualine()
42-
au OptionSet statusline call tpipeline#util#clear_stl()
43-
else
44-
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | endif
45-
endif
46-
endif
47-
au OptionSet statusline call tpipeline#update()
48-
endif
49-
endfunc

0 commit comments

Comments
 (0)