aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/wildmode_spec.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2020-07-31 17:59:48 -0400
committerJames McCoy <jamessan@jamessan.com>2020-07-31 17:59:48 -0400
commit228d7d948200563292f13723cdd0f947bd0c711c (patch)
treee30ac7afb5cfc68470be42e8c5e02907fb44b99b /test/functional/ui/wildmode_spec.lua
parent3e3002b90c46fca8d8d5edebc021e56d95c5e645 (diff)
parent1153ac9036ab62ee25078248a01dc56a2311b9a6 (diff)
downloadrneovim-228d7d948200563292f13723cdd0f947bd0c711c.tar.gz
rneovim-228d7d948200563292f13723cdd0f947bd0c711c.tar.bz2
rneovim-228d7d948200563292f13723cdd0f947bd0c711c.zip
Merge remote-tracking branch 'upstream/master' into fileinfo-garbage
Diffstat (limited to 'test/functional/ui/wildmode_spec.lua')
-rw-r--r--test/functional/ui/wildmode_spec.lua138
1 files changed, 138 insertions, 0 deletions
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index f3fa711fb1..99ebc4971e 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -16,6 +16,44 @@ describe("'wildmenu'", function()
screen:attach()
end)
+ it('C-E to cancel wildmenu completion restore original input', function()
+ feed(':sign <tab>')
+ screen:expect([[
+ |
+ ~ |
+ ~ |
+ define jump list > |
+ :sign define^ |
+ ]])
+ feed('<C-E>')
+ screen:expect([[
+ |
+ ~ |
+ ~ |
+ ~ |
+ :sign ^ |
+ ]])
+ end)
+
+ it('C-Y to apply selection and end wildmenu completion', function()
+ feed(':sign <tab>')
+ screen:expect([[
+ |
+ ~ |
+ ~ |
+ define jump list > |
+ :sign define^ |
+ ]])
+ feed('<tab><C-Y>')
+ screen:expect([[
+ |
+ ~ |
+ ~ |
+ ~ |
+ :sign jump^ |
+ ]])
+ end)
+
it(':sign <tab> shows wildmenu completions', function()
command('set wildmenu wildmode=full')
feed(':sign <tab>')
@@ -221,6 +259,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)