shorten tagbar extension on short windows
This commit is contained in:
parent
0c368681dd
commit
a950a2938a
@ -6,9 +6,15 @@ scriptencoding utf-8
|
|||||||
call airline#init#bootstrap()
|
call airline#init#bootstrap()
|
||||||
let s:spc = g:airline_symbols.space
|
let s:spc = g:airline_symbols.space
|
||||||
|
|
||||||
function! airline#util#shorten(text, winwidth, minwidth)
|
function! airline#util#shorten(text, winwidth, minwidth, ...)
|
||||||
if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
|
if winwidth(0) < a:winwidth && len(split(a:text, '\zs')) > a:minwidth
|
||||||
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
|
if get(a:000, 0, 0)
|
||||||
|
" shorten from tail
|
||||||
|
return '…'.matchstr(a:text, '.\{'.a:minwidth.'}$')
|
||||||
|
else
|
||||||
|
" shorten from beginning of string
|
||||||
|
return matchstr(a:text, '^.\{'.a:minwidth.'}').'…'
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
return a:text
|
return a:text
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user