aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/wildmode_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
committerJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
commit21e2e46242033c7aaa6ccfb23e256680816c063c (patch)
treef089522cfb145d6e9c8a86a01d8e454ce5501e20 /test/functional/ui/wildmode_spec.lua
parent179d3ed87b17988f5fe00d8b99f2611a28212be7 (diff)
parent760b399f6c0c6470daa0663752bd22886997f9e6 (diff)
downloadrneovim-floattitle.tar.gz
rneovim-floattitle.tar.bz2
rneovim-floattitle.zip
Merge remote-tracking branch 'upstream/master' into floattitlefloattitle
Diffstat (limited to 'test/functional/ui/wildmode_spec.lua')
-rw-r--r--test/functional/ui/wildmode_spec.lua100
1 files changed, 55 insertions, 45 deletions
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 98398bc7a1..f1e818119e 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -184,11 +184,10 @@ describe("'wildmenu'", function()
screen:expect_unchanged()
end)
- it('wildmode=list,full and display+=msgsep interaction #10092', function()
+ it('wildmode=list,full and messages interaction #10092', function()
-- Need more than 5 rows, else tabline is covered and will be redrawn.
screen:try_resize(25, 7)
- command('set display+=msgsep')
command('set wildmenu wildmode=list,full')
command('set showtabline=2')
feed(':set wildm<tab>')
@@ -223,44 +222,6 @@ describe("'wildmenu'", function()
]])
end)
- it('wildmode=list,full and display-=msgsep interaction', function()
- -- Need more than 5 rows, else tabline is covered and will be redrawn.
- screen:try_resize(25, 7)
-
- command('set display-=msgsep')
- command('set wildmenu wildmode=list,full')
- feed(':set wildm<tab>')
- screen:expect([[
- ~ |
- ~ |
- ~ |
- ~ |
- :set wildm |
- wildmenu wildmode |
- :set wildm^ |
- ]])
- feed('<tab>') -- trigger wildmode full
- screen:expect([[
- ~ |
- ~ |
- ~ |
- :set wildm |
- wildmenu wildmode |
- wildmenu wildmode |
- :set wildmenu^ |
- ]])
- feed('<Esc>')
- screen:expect([[
- ^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- |
- ]])
- end)
-
it('wildmode=longest,list', function()
-- Need more than 5 rows, else tabline is covered and will be redrawn.
screen:try_resize(25, 7)
@@ -365,7 +326,6 @@ describe("'wildmenu'", function()
screen:try_resize(25, 7)
command('set laststatus=2')
- command('set display+=msgsep')
feed(':set wildm')
feed('<c-d>')
screen:expect([[
@@ -461,20 +421,20 @@ end)
describe('command line completion', function()
local screen
before_each(function()
+ clear()
screen = Screen.new(40, 5)
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {foreground = Screen.colors.Grey0, background = Screen.colors.Yellow},
[3] = {bold = true, reverse = true},
})
+ screen:attach()
end)
after_each(function()
os.remove('Xtest-functional-viml-compl-dir')
end)
it('lists directories with empty PATH', function()
- clear()
- screen:attach()
local tmp = funcs.tempname()
command('e '.. tmp)
command('cd %:h')
@@ -491,8 +451,6 @@ describe('command line completion', function()
end)
it('completes env var names #9681', function()
- clear()
- screen:attach()
command('let $XTEST_1 = "foo" | let $XTEST_2 = "bar"')
command('set wildmenu wildmode=full')
feed(':!echo $XTEST_<tab>')
@@ -521,6 +479,58 @@ describe('command line completion', function()
:!echo $XTEST_1AaあB^ |
]])
end)
+
+ it('does not leak memory with <S-Tab> with wildmenu and only one match #19874', function()
+ meths.set_option('wildmenu', true)
+ meths.set_option('wildmode', 'full')
+ meths.set_option('wildoptions', 'pum')
+
+ feed(':sign unpla<S-Tab>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplace^ |
+ ]])
+
+ feed('<Space>buff<Tab>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplace buffer=^ |
+ ]])
+ end)
+
+ it('does not show matches with <S-Tab> without wildmenu with wildmode=full', function()
+ meths.set_option('wildmenu', false)
+ meths.set_option('wildmode', 'full')
+
+ feed(':sign <S-Tab>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplace^ |
+ ]])
+ end)
+
+ it('shows matches with <S-Tab> without wildmenu with wildmode=list', function()
+ meths.set_option('wildmenu', false)
+ meths.set_option('wildmode', 'list')
+
+ feed(':sign <S-Tab>')
+ screen:expect([[
+ {3: }|
+ :sign define |
+ define list undefine |
+ jump place unplace |
+ :sign unplace^ |
+ ]])
+ end)
end)
describe('ui/ext_wildmenu', function()