refactor shortening code

This commit is contained in:
Christian Brabandt
2016-07-02 09:49:05 +02:00
parent 5b00d54cd6
commit 409e8b0cbd
3 changed files with 10 additions and 9 deletions

View File

@@ -106,12 +106,7 @@ function! airline#extensions#whitespace#check()
endif
endif
endif
if winwidth(0) < 120 && len(split(b:airline_whitespace_check, '\zs')) > 9
return matchstr(b:airline_whitespace_check, '^.\{9\}').'…'
else
return b:airline_whitespace_check
endif
return airline#util#shorten(b:airline_whitespace_check, 120, 9)
endfunction
function! airline#extensions#whitespace#toggle()