diff options
Diffstat (limited to 'test/functional/ui/wildmode_spec.lua')
-rw-r--r-- | test/functional/ui/wildmode_spec.lua | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index f3fa711fb1..56987d7bc2 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -221,6 +221,106 @@ describe("'wildmenu'", function() ]]) end) + it('wildmode=longest,list', function() + -- Need more than 5 rows, else tabline is covered and will be redrawn. + screen:try_resize(25, 7) + + command('set wildmenu wildmode=longest,list') + + -- give wildmode-longest something to expand to + feed(':sign u<tab>') + screen:expect([[ + | + ~ | + ~ | + ~ | + ~ | + ~ | + :sign un^ | + ]]) + feed('<tab>') -- trigger wildmode list + screen:expect([[ + | + ~ | + ~ | + | + :sign un | + undefine unplace | + :sign un^ | + ]]) + feed('<Esc>') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + ~ | + ~ | + | + ]]) + + -- give wildmode-longest something it cannot expand, use list + feed(':sign un<tab>') + screen:expect([[ + | + ~ | + ~ | + | + :sign un | + undefine unplace | + :sign un^ | + ]]) + feed('<tab>') + screen:expect_unchanged() + feed('<Esc>') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + ~ | + ~ | + | + ]]) + end) + + it('wildmode=list,longest', function() + -- Need more than 5 rows, else tabline is covered and will be redrawn. + screen:try_resize(25, 7) + + command('set wildmenu wildmode=list,longest') + feed(':sign u<tab>') + screen:expect([[ + | + ~ | + ~ | + | + :sign u | + undefine unplace | + :sign u^ | + ]]) + feed('<tab>') -- trigger wildmode longest + screen:expect([[ + | + ~ | + ~ | + | + :sign u | + undefine unplace | + :sign un^ | + ]]) + feed('<Esc>') + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + ~ | + ~ | + | + ]]) + end) + it('multiple <C-D> renders correctly', function() screen:try_resize(25, 7) |