Skip to content

Commit 382e33f

Browse files
committed
Refactor clearing of stl
Move common functionality into clear_stl()
1 parent d30a024 commit 382e33f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

autoload/tpipeline.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func tpipeline#build_hooks()
3333
endif
3434

3535
if empty(g:tpipeline_statusline) && !g:tpipeline_tabline && g:tpipeline_clearstl
36-
au OptionSet statusline if v:option_type == 'global' | let g:tpipeline_statusline = &stl | set stl=%#StatusLine# | call tpipeline#update() | endif
36+
au OptionSet statusline if v:option_type == 'global' | call tpipeline#util#clear_stl() | call tpipeline#update() | endif
3737
endif
3838
augroup END
3939
endfunc
@@ -189,8 +189,7 @@ func tpipeline#init_statusline()
189189
set stl=%!tpipeline#stl#line()
190190
endif
191191
if g:tpipeline_clearstl
192-
let g:tpipeline_statusline = &stl
193-
set stl=%#StatusLine#
192+
call tpipeline#util#clear_stl()
194193
endif
195194
endif
196195
endif

autoload/tpipeline/util.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ endfunc
2424
func tpipeline#util#remove_align(str)
2525
return substitute(a:str, '%=', '', 'g')
2626
endfunc
27+
28+
func tpipeline#util#clear_stl()
29+
let g:tpipeline_statusline = &stl
30+
set stl=%#StatusLine#
31+
endfunc

0 commit comments

Comments
 (0)