Make fileformat output truncatable

closes #1309
This commit is contained in:
Christian Brabandt
2016-12-13 21:44:57 +01:00
parent a0ea8db1fc
commit a69834f7dc
2 changed files with 14 additions and 1 deletions

View File

@@ -88,5 +88,12 @@ function! airline#parts#filetype()
endfunction
function! airline#parts#ffenc()
return printf('%s%s%s', &fenc, &l:bomb ? '[BOM]' : '', strlen(&ff) > 0 ? '['.&ff.']' : '')
let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '')
let bomb = &l:bomb ? '[BOM]' : ''
let ff = strlen(&ff) ? '['.&ff.']' : ''
if expected is# &fenc.bomb.ff
return ''
else
return &fenc.bomb.ff
endif
endfunction