Better reformat wordcount format in with separator
This commit is contained in:
parent
b2bbe7dbc2
commit
db01efd508
|
@ -13,9 +13,7 @@ function! airline#extensions#wordcount#formatters#default#format()
|
||||||
let separator = s:get_decimal_group()
|
let separator = s:get_decimal_group()
|
||||||
if words > 999 && !empty(separator)
|
if words > 999 && !empty(separator)
|
||||||
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
" Format number according to locale, e.g. German: 1.245 or English: 1,245
|
||||||
let a = join(reverse(split(words, '.\zs')),'')
|
let words = substitute(words, '\d\@<=\(\(\d\{3\}\)\+\)$', separator.'&', 'g')
|
||||||
let a = substitute(a, '...', '&'.separator, 'g')
|
|
||||||
let words = join(reverse(split(a, '.\zs')),'')
|
|
||||||
endif
|
endif
|
||||||
let result = printf("%s%s", words, " words"). result
|
let result = printf("%s%s", words, " words"). result
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue