mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
vim-patch:8.2.0235: draw error when an empty group is removed from 'statusline'
Problem: Draw error when an empty group is removed from 'statusline'.
Solution: Do not use highlighting from a removed group.
dbe5d361fe
This commit is contained in:
@@ -3531,6 +3531,12 @@ int build_stl_str_hl(
|
||||
if (n == curitem && group_start_userhl == group_end_userhl) {
|
||||
out_p = t;
|
||||
group_len = 0;
|
||||
// do not use the highlighting from the removed group
|
||||
for (n = groupitems[groupdepth] + 1; n < curitem; n++) {
|
||||
if (items[n].type == Highlight) {
|
||||
items[n].type = Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -369,3 +369,24 @@ func Test_statusline_visual()
|
||||
bwipe! x1
|
||||
bwipe! x2
|
||||
endfunc
|
||||
|
||||
func Test_statusline_removed_group()
|
||||
if !CanRunVimInTerminal()
|
||||
throw 'Skipped: cannot make screendumps'
|
||||
endif
|
||||
|
||||
let lines =<< trim END
|
||||
scriptencoding utf-8
|
||||
set laststatus=2
|
||||
let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡'
|
||||
END
|
||||
call writefile(lines, 'XTest_statusline')
|
||||
|
||||
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50})
|
||||
call term_wait(buf, 100)
|
||||
call VerifyScreenDump(buf, 'Test_statusline_1', {})
|
||||
|
||||
" clean up
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('XTest_statusline')
|
||||
endfunc
|
||||
|
Reference in New Issue
Block a user