mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-26 10:13:42 +08:00
do not render accents in inactive splits. resolves #270.
This commit is contained in:
parent
bb30c09371
commit
b5e8ea275e
|
@ -23,6 +23,7 @@ function! s:prototype.add_section(group, contents)
|
|||
let self._line .= '%#'.a:group.'#'
|
||||
endif
|
||||
|
||||
if self._context.active
|
||||
let contents = []
|
||||
let content_parts = split(a:contents, '__accent')
|
||||
for cpart in content_parts
|
||||
|
@ -32,6 +33,10 @@ function! s:prototype.add_section(group, contents)
|
|||
endfor
|
||||
let line = join(contents, a:group)
|
||||
let line = substitute(line, '__restore__', a:group, 'g')
|
||||
else
|
||||
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
|
||||
let line = substitute(line, '%#__restore__#', '', 'g')
|
||||
endif
|
||||
|
||||
let self._line .= line
|
||||
let self._curgroup = a:group
|
||||
|
|
|
@ -70,5 +70,11 @@ describe 'inactive builder'
|
|||
let stl = s:builder.build()
|
||||
Expect stl =~ '%#Normal_inactive#hello%#Normal_to_NonText_inactive#>%#NonText_inactive#world'
|
||||
end
|
||||
|
||||
it 'should not render accents'
|
||||
call s:builder.add_section('Normal', '%#__accent_foo#hello%#foo#foo%#__accent_bar#world')
|
||||
let stl = s:builder.build()
|
||||
Expect stl == '%#Normal_inactive#hello%#foo_inactive#fooworld'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user