mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
Merge pull request #11905 from bfredl/backport-patch-8.2.0235
[release-0.4] vim-patch:8.2.0235
This commit is contained in:
@@ -3532,6 +3532,12 @@ int build_stl_str_hl(
|
|||||||
if (n == curitem && group_start_userhl == group_end_userhl) {
|
if (n == curitem && group_start_userhl == group_end_userhl) {
|
||||||
out_p = t;
|
out_p = t;
|
||||||
group_len = 0;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -347,3 +347,24 @@ func Test_statusline()
|
|||||||
set laststatus&
|
set laststatus&
|
||||||
set splitbelow&
|
set splitbelow&
|
||||||
endfunc
|
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
|
||||||
|
@@ -127,6 +127,10 @@ describe('multibyte rendering: statusline', function()
|
|||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
screen = Screen.new(40, 4)
|
screen = Screen.new(40, 4)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = {bold = true, foreground = Screen.colors.Blue1},
|
||||||
|
[2] = {bold = true, reverse = true},
|
||||||
|
})
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command('set laststatus=2')
|
command('set laststatus=2')
|
||||||
end)
|
end)
|
||||||
@@ -139,8 +143,8 @@ describe('multibyte rendering: statusline', function()
|
|||||||
command('set statusline=你好')
|
command('set statusline=你好')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
{1:~ }|
|
||||||
你好 |
|
{2:你好 }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -148,8 +152,8 @@ describe('multibyte rendering: statusline', function()
|
|||||||
command('set statusline=abc')
|
command('set statusline=abc')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
{1:~ }|
|
||||||
abc |
|
{2:abc }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -157,8 +161,8 @@ describe('multibyte rendering: statusline', function()
|
|||||||
command('set statusline=')
|
command('set statusline=')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
{1:~ }|
|
||||||
<9f> |
|
{2:<9f> }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -167,8 +171,8 @@ describe('multibyte rendering: statusline', function()
|
|||||||
-- o + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD
|
-- o + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
{1:~ }|
|
||||||
o̸⃯ᷰ⃐⃧⃝ |
|
{2:o̸⃯ᷰ⃐⃧⃝ }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
@@ -177,9 +181,19 @@ describe('multibyte rendering: statusline', function()
|
|||||||
-- U+9F + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD
|
-- U+9F + U+1DF0 + U+20EF + U+0338 + U+20D0 + U+20E7 + U+20DD
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
^ |
|
^ |
|
||||||
~ |
|
{1:~ }|
|
||||||
<9f><1df0><20ef><0338><20d0><20e7><20dd>|
|
{2:<9f><1df0><20ef><0338><20d0><20e7><20dd>}|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('hidden group %( %) does not cause invalid unicode', function()
|
||||||
|
command("let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡'")
|
||||||
|
screen:expect{grid=[[
|
||||||
|
^ |
|
||||||
|
{1:~ }|
|
||||||
|
{2: Q≡ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user