Skip to content

Commit 6142ad2

Browse files
committed
Refactor statusline OptionSet into function
1 parent a61f610 commit 6142ad2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

autoload/tpipeline.vim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ func tpipeline#build_hooks()
3232
au CursorMoved * call tpipeline#update()
3333
endif
3434

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()
40-
endif
35+
call tpipeline#util#set_stl_hooks()
4136
augroup END
4237
endfunc
4338

autoload/tpipeline/util.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ func tpipeline#util#clear_stl()
2929
let g:tpipeline_statusline = &stl
3030
set stl=%#StatusLine#
3131
endfunc
32+
33+
func tpipeline#util#set_stl_hooks()
34+
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline
35+
if g:tpipeline_clearstl
36+
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | endif
37+
endif
38+
au OptionSet statusline call tpipeline#update()
39+
endif
40+
endfunc

0 commit comments

Comments
 (0)