screen: setup scrolling main screen when starting with display-=msgsep

This commit is contained in:
Björn Linse 2021-03-23 08:51:20 +01:00
parent d41778c993
commit 80e122ae5d
2 changed files with 37 additions and 8 deletions

View File

@ -110,6 +110,7 @@ static char uilog_last_event[1024] = { 0 };
void ui_init(void)
{
default_grid.handle = 1;
msg_grid_adj.target = &default_grid;
ui_comp_init();
}

View File

@ -24,10 +24,6 @@ describe('screen', function()
} )
end)
after_each(function()
screen:detach()
end)
it('default initial screen', function()
screen:expect([[
^ |
@ -67,10 +63,6 @@ local function screen_tests(linegrid)
} )
end)
after_each(function()
screen:detach()
end)
describe(':suspend', function()
it('is forwarded to the UI', function()
local function check()
@ -1004,3 +996,39 @@ describe('Screen default colors', function()
end}
end)
end)
describe('screen with msgsep deactivated on startup', function()
local screen
before_each(function()
clear('--cmd', 'set display-=msgsep')
screen = Screen.new()
screen:attach()
screen:set_default_attr_ids {
[0] = {bold=true, foreground=255};
[7] = {bold = true, foreground = Screen.colors.SeaGreen};
}
end)
it('execute command with multi-line output', function()
feed ':ls<cr>'
screen:expect([[
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
:ls |
1 %a "[No Name]" line 1 |
{7:Press ENTER or type command to continue}^ |
]])
feed '<cr>' -- skip the "Press ENTER..." state or tests will hang
end)
end)