Merge pull request #11755 from bfredl/qf_msg

screen: add missing redraws after a message
This commit is contained in:
Björn Linse 2020-01-26 15:38:04 +01:00 committed by GitHub
commit 6f073ccbf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 97 additions and 0 deletions

View File

@ -370,6 +370,17 @@ int update_screen(int type)
grid_clear_line(&default_grid, default_grid.line_offset[i],
Columns, false);
}
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp->w_floating) {
continue;
}
if (W_ENDROW(wp) > valid) {
wp->w_redr_type = MAX(wp->w_redr_type, NOT_VALID);
}
if (W_ENDROW(wp) + wp->w_status_height > valid) {
wp->w_redr_status = true;
}
}
}
msg_grid_set_pos(Rows-p_ch, false);
msg_grid_invalid = false;

View File

@ -811,6 +811,8 @@ describe('ui/builtin messages', function()
[5] = {foreground = Screen.colors.Blue1},
[6] = {bold = true, foreground = Screen.colors.Magenta},
[7] = {background = Screen.colors.Grey20},
[8] = {reverse = true},
[9] = {background = Screen.colors.LightRed}
})
end)
@ -962,6 +964,90 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
zbc |
]]}
end)
it('redraws NOT_VALID correctly after message', function()
-- edge case: only one window was set NOT_VALID. Orginal report
-- used :make, but fake it using one command to set the current
-- window NOT_VALID and another to show a long message.
feed(':new<cr><c-w><c-w>')
screen:expect{grid=[[
|
{1:~ }|
{8:[No Name] }|
^ |
{1:~ }|
{3:[No Name] }|
:new |
]]}
feed(':set colorcolumn=10 | digraphs<cr>')
screen:expect{grid=[[
er {5:} 12582 i4 {5:} 12583 u4 {5:} 12584 iu {5:} 12585 |
v4 {5:} 12586 nG {5:} 12587 gn {5:} 12588 1c {5:} 12832 |
2c {5:} 12833 3c {5:} 12834 4c {5:} 12835 5c {5:} 12836 |
6c {5:} 12837 7c {5:} 12838 8c {5:} 12839 9c {5:} 12840 |
ff {5:} 64256 fi {5:} 64257 fl {5:} 64258 ft {5:} 64261 |
st {5:} 64262 |
{4:Press ENTER or type command to continue}^ |
]]}
feed('<cr>')
screen:expect{grid=[[
|
{1:~ }|
{8:[No Name] }|
^ {9: } |
{1:~ }|
{3:[No Name] }|
|
]]}
-- edge case: just covers statusline
feed(':set colorcolumn=5 | lua error("x\\n\\nx")<cr>')
screen:expect{grid=[[
|
{1:~ }|
{3: }|
{2:E5108: Error executing lua [string ":lua"]:1: x} |
|
{2:x} |
{4:Press ENTER or type command to continue}^ |
]]}
feed('<cr>')
screen:expect{grid=[[
|
{1:~ }|
{8:[No Name] }|
^ {9: } |
{1:~ }|
{3:[No Name] }|
|
]]}
-- edge case: just covers lowest window line
feed(':set colorcolumn=5 | lua error("x\\n\\n\\nx")<cr>')
screen:expect{grid=[[
|
{3: }|
{2:E5108: Error executing lua [string ":lua"]:1: x} |
|
|
{2:x} |
{4:Press ENTER or type command to continue}^ |
]]}
feed('<cr>')
screen:expect{grid=[[
|
{1:~ }|
{8:[No Name] }|
^ {9: } |
{1:~ }|
{3:[No Name] }|
|
]]}
end)
end)
describe('ui/ext_messages', function()