diff options
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 42734d07ca..8c050195ee 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -79,6 +79,7 @@ end --- @field win_position table<integer,table<string,integer>> --- @field float_pos table<integer,table> --- @field cmdline table<integer,table> +--- @field cmdline_hide_level integer? --- @field cmdline_block table[] --- @field hl_groups table<string,integer> --- @field messages table<integer,table> @@ -654,6 +655,12 @@ screen:redraw_debug() to show all intermediate screen states.]] end end + -- Only test the abort state of a cmdline level once. + if self.cmdline_hide_level ~= nil then + self.cmdline[self.cmdline_hide_level] = nil + self.cmdline_hide_level = nil + end + if expected.hl_groups ~= nil then for name, id in pairs(expected.hl_groups) do local expected_hl = attr_state.ids[id] @@ -1296,7 +1303,7 @@ function Screen:_handle_popupmenu_hide() self.popupmenu = nil end -function Screen:_handle_cmdline_show(content, pos, firstc, prompt, indent, level) +function Screen:_handle_cmdline_show(content, pos, firstc, prompt, indent, level, hl_id) if firstc == '' then firstc = nil end @@ -1320,11 +1327,13 @@ function Screen:_handle_cmdline_show(content, pos, firstc, prompt, indent, level firstc = firstc, prompt = prompt, indent = indent, + hl_id = prompt and hl_id, } end -function Screen:_handle_cmdline_hide(level) - self.cmdline[level] = nil +function Screen:_handle_cmdline_hide(level, abort) + self.cmdline[level] = { abort = abort } + self.cmdline_hide_level = level end function Screen:_handle_cmdline_special_char(char, shift, level) @@ -1468,7 +1477,9 @@ function Screen:_extstate_repr(attr_state) local cmdline = {} for i, entry in pairs(self.cmdline) do entry = shallowcopy(entry) - entry.content = self:_chunks_repr(entry.content, attr_state) + if entry.content ~= nil then + entry.content = self:_chunks_repr(entry.content, attr_state) + end cmdline[i] = entry end |