diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-03-23 08:51:20 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-03-23 09:34:36 +0100 |
commit | 80e122ae5d6bc02c8bea33528f0e1d16e48489b6 (patch) | |
tree | f14dbe654b7a186980c1d81c567c4be9374af373 | |
parent | d41778c993e95c8b37b3d8e10dacc3060ae489da (diff) | |
download | rneovim-80e122ae5d6bc02c8bea33528f0e1d16e48489b6.tar.gz rneovim-80e122ae5d6bc02c8bea33528f0e1d16e48489b6.tar.bz2 rneovim-80e122ae5d6bc02c8bea33528f0e1d16e48489b6.zip |
screen: setup scrolling main screen when starting with display-=msgsep
-rw-r--r-- | src/nvim/ui.c | 1 | ||||
-rw-r--r-- | test/functional/ui/screen_basic_spec.lua | 44 |
2 files changed, 37 insertions, 8 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index c6c09c80d7..94b6e9e39d 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -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(); } diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index ff9f30d0a1..958e137f65 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -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) |