mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-07-27 07:54:44 +02:00
builder: correctly remember the previous group when switching alignment
When `g:airline_skip_empty_sections' is set, and a section is considered and after that section comes the alignment separator '%=' than airline would not correctly render the airline_prevgroup_to_airline_curgroup simply because the '%=' marker confuses it about which is actually the previous group. So consider the '%=' marker to be empty as well. The case can be observed, when having set `g:airline_skip_empty_sections' to true and opening a help buffer. Because in that case, airline_section_c will be considered empty, then the alignment separator comes and after that airline will (wrongly) generate a highlighting group `airline_c_to_airline_z`, while it should actually generate `airline_b_to_airline_z`
This commit is contained in:
parent
f5a6597496
commit
90c6746311
@ -199,7 +199,12 @@ function! s:section_is_empty(self, content)
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(a:content)
|
" special case: When the content is %=, that is the
|
||||||
|
" separation marker, which switches between left- and
|
||||||
|
" right-aligned content.
|
||||||
|
" Consider that to be empty, so that the previous previous
|
||||||
|
" group is correctly remembered in the builder() function
|
||||||
|
if empty(a:content) || a:content is# '%='
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user