From 66f4e8aee0bb810342364eaf6c9486918cbf1f17 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 2 Sep 2019 10:46:24 +0200 Subject: screen: initialize screen properly with early `set display-=msgsep` Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the message grid and remove it just afterwards. While inefficient, we must make sure update_screen() re-validates the default_grid completely when this happens. Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not used. Elide a too early ui_flush() on startup, which caused an invalid cursor position to be used. --- test/functional/ui/embed_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/functional/ui/embed_spec.lua') diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua index 5e09dc4289..f3cd223f53 100644 --- a/test/functional/ui/embed_spec.lua +++ b/test/functional/ui/embed_spec.lua @@ -81,6 +81,20 @@ local function test_embed(ext_linegrid) eq(Screen.colors.Green, screen.default_colors.rgb_bg) end} end) + + it("set display-=msgsep before first redraw", function() + startup('--cmd', 'set display-=msgsep') + screen:expect{grid=[[ + ^ | + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + {3:~ }| + | + ]]} + end) end describe('--embed UI on startup (ext_linegrid=true)', function() test_embed(true) end) -- cgit