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