remove redundant highlight group.
This commit is contained in:
parent
db58294871
commit
ad3556d243
@ -19,7 +19,11 @@ function! s:prototype.add_section(group, contents)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let self._line .= '%#'.a:group.'#'.a:contents
|
if self._curgroup != a:group
|
||||||
|
let self._line .= '%#'.a:group.'#'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let self._line .= a:contents
|
||||||
let self._curgroup = a:group
|
let self._curgroup = a:group
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -30,6 +30,13 @@ describe 'active builder'
|
|||||||
let stl = s:builder.build()
|
let stl = s:builder.build()
|
||||||
Expect stl =~ '%#Normal#hello%#Normal_to_NonText#<%#NonText#world'
|
Expect stl =~ '%#Normal#hello%#Normal_to_NonText#<%#NonText#world'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not repeat the same highlight group'
|
||||||
|
call s:builder.add_section('Normal', 'hello')
|
||||||
|
call s:builder.add_section('Normal', 'hello')
|
||||||
|
let stl = s:builder.build()
|
||||||
|
Expect stl == '%#Normal#hello>hello'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'inactive builder'
|
describe 'inactive builder'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user