Small wordcount format output on windows < 80
This commit is contained in:
parent
562d060b08
commit
b2bbe7dbc2
|
@ -8,6 +8,8 @@ function! airline#extensions#wordcount#formatters#default#format()
|
|||
if empty(words)
|
||||
return
|
||||
endif
|
||||
let result = g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
if winwidth(0) >= 80
|
||||
let separator = s:get_decimal_group()
|
||||
if words > 999 && !empty(separator)
|
||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||
|
@ -15,7 +17,11 @@ function! airline#extensions#wordcount#formatters#default#format()
|
|||
let a = substitute(a, '...', '&'.separator, 'g')
|
||||
let words = join(reverse(split(a, '.\zs')),'')
|
||||
endif
|
||||
return words . " words" . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space
|
||||
let result = printf("%s%s", words, " words"). result
|
||||
else
|
||||
let result = printf("%s%s", words, "W"). result
|
||||
endif
|
||||
return result
|
||||
endfunction
|
||||
|
||||
function! s:wordcount()
|
||||
|
|
Loading…
Reference in New Issue