From 463174b5d76d9a88fab02db144aaaac7fa19efd1 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Tue, 8 Feb 2022 20:28:52 +0600 Subject: fix(ui): make window resize commands manage cmdheight Previously, the window resize commands did not resize the value of `cmdheight` when they caused a change in the topframe height, leaving a gap between the end of topframe and the start of the command line, this commit fixes that by making window resize commands automatically change the value of cmdheight if the resize affects the height of topframe. --- test/functional/legacy/cmdline_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index 9ebe9aeb91..2868279a97 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -33,8 +33,8 @@ describe('cmdline', function() ~ | ~ | ~ | - 6 | - 7 | + | + | | ]]) end) -- cgit From 6dc31eea438d4ebda06f625b0b656882c806570c Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 5 Apr 2022 16:48:47 +0200 Subject: fix(tests): update legacy tab switch test to be sane --- test/functional/legacy/cmdline_spec.lua | 66 +++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index 2868279a97..d8d849271b 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -11,6 +11,15 @@ describe('cmdline', function() it('is cleared when switching tabs', function() local screen = Screen.new(30, 10) screen:attach() + screen:set_default_attr_ids { + [1] = {underline = true, background = Screen.colors.LightGrey}; + [2] = {bold = true}; + [3] = {reverse = true}; + [4] = {bold = true, foreground = Screen.colors.Blue1}; + } + -- TODO(bfredl): redraw with tabs is severly broken. fix it + feed_command [[ set display-=msgsep ]] + feed_command([[call setline(1, range(30))]]) screen:expect([[ ^0 | @@ -24,15 +33,58 @@ describe('cmdline', function() 8 | :call setline(1, range(30)) | ]]) - feed([[:tabnew--gtgt]]) + + feed [[:tabnew]] + screen:expect{grid=[[ + {1: + [No Name] }{2: [No Name] }{3: }{1:X}| + ^ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + :tabnew | + ]]} + + feed [[--]] + screen:expect{grid=[[ + {1: + [No Name] }{2: [No Name] }{3: }{1:X}| + ^ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + | + | + :tabnew | + ]]} + + feed [[gt]] + screen:expect{grid=[[ + {2: + [No Name] }{1: [No Name] }{3: }{1:X}| + ^0 | + 1 | + 2 | + 3 | + 4 | + 5 | + 6 | + 7 | + | + ]]} + + feed [[gt]] screen:expect([[ - + [No Name] [No Name] X| + {1: + [No Name] }{2: [No Name] }{3: }{1:X}| ^ | - ~ | - ~ | - ~ | - ~ | - ~ | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| | | | -- cgit