mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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.
This commit is contained in:
@@ -4216,6 +4216,10 @@ build_stl_str_hl(
|
|||||||
{
|
{
|
||||||
p = t;
|
p = t;
|
||||||
l = 0;
|
l = 0;
|
||||||
|
// do not use the highlighting from the removed group
|
||||||
|
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
|
||||||
|
if (item[n].type == Highlight)
|
||||||
|
item[n].type = Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (l > item[groupitem[groupdepth]].maxwid)
|
if (l > item[groupitem[groupdepth]].maxwid)
|
||||||
|
10
src/testdir/dumps/Test_statusline_1.dump
Normal file
10
src/testdir/dumps/Test_statusline_1.dump
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
> +0&#ffffff0@49
|
||||||
|
|~+0#4040ff13&| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
|~| @48
|
||||||
|
| +3#0000000&|Q|≡| @46
|
||||||
|
| +0&&@49
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
source check.vim
|
source check.vim
|
||||||
|
source screendump.vim
|
||||||
|
|
||||||
func s:get_statusline()
|
func s:get_statusline()
|
||||||
return ScreenLines(&lines - 1, &columns)[0]
|
return ScreenLines(&lines - 1, &columns)[0]
|
||||||
@@ -393,3 +394,22 @@ func Test_statusline_visual()
|
|||||||
bwipe! x1
|
bwipe! x1
|
||||||
bwipe! x2
|
bwipe! x2
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_statusline_removed_group()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
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
|
||||||
|
@@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
235,
|
||||||
/**/
|
/**/
|
||||||
234,
|
234,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user