mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
vim-patch:8.0.1220: skipping empty statusline groups is not correct
Problem: Skipping empty statusline groups is not correct.
Solution: Also set group_end_userhl. (itchyny)
235dddf1f4
This commit is contained in:
parent
83c9d1df1b
commit
4ed654d9e8
@ -3485,9 +3485,10 @@ int build_stl_str_hl(
|
||||
int group_start_userhl = 0;
|
||||
int group_end_userhl = 0;
|
||||
int n;
|
||||
for (n = 0; n < groupitems[groupdepth]; n++) {
|
||||
for (n = groupitems[groupdepth] - 1; n >= 0; n--) {
|
||||
if (items[n].type == Highlight) {
|
||||
group_start_userhl = items[n].minwid;
|
||||
group_start_userhl = group_end_userhl = items[n].minwid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (n = groupitems[groupdepth] + 1; n < curitem; n++) {
|
||||
|
@ -312,6 +312,12 @@ func Test_statusline()
|
||||
call assert_equal(sa1, sa3)
|
||||
call assert_equal(sa1, sa4)
|
||||
|
||||
let g:a = ''
|
||||
set statusline=%#Error#{%(\ %{g:a}\ %)}
|
||||
call assert_match('^{}\s*$', s:get_statusline())
|
||||
let g:a = 'X'
|
||||
call assert_match('^{ X }\s*$', s:get_statusline())
|
||||
|
||||
" %%: a percent sign.
|
||||
set statusline=10%%
|
||||
call assert_match('^10%\s*$', s:get_statusline())
|
||||
|
Loading…
Reference in New Issue
Block a user