Fix #462 - Configurable head limit.

This commit is contained in:
Ben Joldersma 2014-05-21 10:41:53 -07:00
parent bfcece76c9
commit 4f904ab0d4
2 changed files with 11 additions and 1 deletions

View File

@ -65,6 +65,13 @@ function! airline#extensions#branch#head()
let b:airline_head = ''
endif
if exists("g:airline#extensions#branch#displayed_head_limit")
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
if len(b:airline_head) > w:displayed_head_limit - 1
let b:airline_head = b:airline_head[0:w:displayed_head_limit - 1].'…'
endif
endif
return b:airline_head
endfunction

View File

@ -282,7 +282,10 @@ vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
* use vcscommand.vim if available >
let g:airline#extensions#branch#use_vcscommand = 0
<
* truncate long branch names to a fixed length >
let g:airline#extensions#branch#displayed_head_limit = 10
------------------------------------- *airline-syntastic*
syntastic <https://github.com/scrooloose/syntastic>