NrrwRgn: Only use Utf-8 Glyph in utf8 encoding

Fixes #567
This commit is contained in:
Christian Brabandt 2016-01-23 21:31:34 +01:00
parent 8fb92586ee
commit e42c0b0f33

View File

@ -39,7 +39,8 @@ function! airline#extensions#nrrwrgn#apply(...)
endif endif
endif endif
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1])) let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!')) call a:1.add_section('airline_c', printf("%s %s %s", name, range,
\ dict.enabled ? (&encoding ==? 'utf-8' ? "\u2713" : '') : '!'))
call a:1.split() call a:1.split()
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc) call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc) call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)