From 5487624730b60426632326dde41383069754916b Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 20 Sep 2018 12:06:19 +0200 Subject: startup: don't erase screen on `:hi Normal` during startup NB: existing `color default` test was actually enough to trigger the bug, when ext_newgrid=false is used. I created the `:hi Normal` test as I thought the builtin colors wouldn't set Normal (unless 'bg' is changed) But as the root cause actually comes from `:hi Normal`, it makes sense to still add the separate test (if `color default` here gets optimized to become a no-op, or something). --- test/functional/ui/screen.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'test/functional/ui/screen.lua') diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index b242fddb78..364b65c581 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -183,7 +183,7 @@ end function Screen:attach(options) if options == nil then - options = {rgb=true} + options = {} end if options.ext_newgrid == nil then options.ext_newgrid = true @@ -191,6 +191,11 @@ function Screen:attach(options) self._options = options self._clear_attrs = (options.ext_newgrid and {{},{}}) or {} uimeths.attach(self._width, self._height, options) + if self._options.rgb == nil then + -- nvim defaults to rgb=true internally, + -- simplify test code by doing the same. + self._options.rgb = true + end end function Screen:detach() @@ -641,7 +646,14 @@ function Screen:_handle_visual_bell() self.visual_bell = true end -function Screen:_handle_default_colors_set() +function Screen:_handle_default_colors_set(rgb_fg, rgb_bg, rgb_sp, cterm_fg, cterm_bg) + self.default_colors = { + rgb_fg=rgb_fg, + rgb_bg=rgb_bg, + rgb_sp=rgb_sp, + cterm_fg=cterm_fg, + cterm_bg=cterm_bg + } end function Screen:_handle_update_fg(fg) -- cgit