aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/api/buffer_spec.lua56
-rw-r--r--test/functional/lua/overrides_spec.lua16
-rw-r--r--test/functional/ui/cmdline_spec.lua131
-rw-r--r--test/functional/ui/float_spec.lua8
-rw-r--r--test/functional/ui/messages_spec.lua6
-rw-r--r--test/functional/ui/popupmenu_spec.lua264
-rw-r--r--test/functional/ui/screen.lua5
-rw-r--r--test/functional/ui/wildmode_spec.lua21
8 files changed, 456 insertions, 51 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index 93599c04f1..d26cb0dbb3 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -24,8 +24,8 @@ describe('api/buf', function()
end
- describe('line_count, insert and del_line', function()
- it('works', function()
+ describe('nvim_buf_set_lines, nvim_buf_line_count', function()
+ it('deprecated forms', function()
eq(1, curbuf_depr('line_count'))
curbuf_depr('insert', -1, {'line'})
eq(2, curbuf_depr('line_count'))
@@ -70,7 +70,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set,del}_line', function()
+ describe('deprecated: {get,set,del}_line', function()
it('works', function()
eq('', curbuf_depr('get_line', 0))
curbuf_depr('set_line', 0, 'line1')
@@ -102,7 +102,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set}_line_slice', function()
+ describe('deprecated: {get,set}_line_slice', function()
it('get_line_slice: out-of-bounds returns empty array', function()
curbuf_depr('set_line_slice', 0, 0, true, true, {'a', 'b', 'c'})
eq({'a', 'b', 'c'}, curbuf_depr('get_line_slice', 0, 2, true, true)) --sanity
@@ -149,7 +149,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set}_lines', function()
+ describe('nvim_buf_get_lines, nvim_buf_set_lines', function()
local get_lines, set_lines = curbufmeths.get_lines, curbufmeths.set_lines
local line_count = curbufmeths.line_count
@@ -272,7 +272,7 @@ describe('api/buf', function()
eq({}, get_lines(-3, -4, true))
end)
- it('set_line_slice: out-of-bounds can extend past end', function()
+ it('set_lines: out-of-bounds can extend past end', function()
set_lines(0, -1, true, {'a', 'b', 'c'})
eq({'a', 'b', 'c'}, get_lines(0, -1, true)) --sanity
@@ -286,7 +286,7 @@ describe('api/buf', function()
eq({'e', 'a', 'b', 'c', 'd'}, get_lines(0, -1, true))
end)
- it("set_line on alternate buffer does not access invalid line (E315)", function()
+ it("set_lines on alternate buffer does not access invalid line (E315)", function()
feed_command('set hidden')
insert('Initial file')
command('enew')
@@ -334,9 +334,27 @@ describe('api/buf', function()
{2:-- INSERT --} |
]])
end)
+
+ it('set_lines on hidden buffer preserves "previous window" #9741', function()
+ insert([[
+ visible buffer line 1
+ line 2
+ ]])
+ local hiddenbuf = meths.create_buf(false,true)
+ command('vsplit')
+ command('vsplit')
+ feed('<c-w>l<c-w>l<c-w>l')
+ eq(3, funcs.winnr())
+ feed('<c-w>h')
+ eq(2, funcs.winnr())
+ meths.buf_set_lines(hiddenbuf, 0, -1, true,
+ {'hidden buffer line 1', 'line 2'})
+ feed('<c-w>p')
+ eq(3, funcs.winnr())
+ end)
end)
- describe('get_offset', function()
+ describe('nvim_buf_get_offset', function()
local get_offset = curbufmeths.get_offset
it('works', function()
curbufmeths.set_lines(0,-1,true,{'Some\r','exa\000mple', '', 'buf\rfer', 'text'})
@@ -373,7 +391,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set,del}_var', function()
+ describe('nvim_buf_get_var, nvim_buf_set_var, nvim_buf_del_var', function()
it('works', function()
curbuf('set_var', 'lua', {1, 2, {['3'] = 1}})
eq({1, 2, {['3'] = 1}}, curbuf('get_var', 'lua'))
@@ -393,7 +411,7 @@ describe('api/buf', function()
end)
end)
- describe('get_changedtick', function()
+ describe('nvim_buf_get_changedtick', function()
it('works', function()
eq(2, curbufmeths.get_changedtick())
curbufmeths.set_lines(0, 1, false, {'abc\0', '\0def', 'ghi'})
@@ -417,7 +435,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set}_option', function()
+ describe('nvim_buf_get_option, nvim_buf_set_option', function()
it('works', function()
eq(8, curbuf('get_option', 'shiftwidth'))
curbuf('set_option', 'shiftwidth', 4)
@@ -430,7 +448,7 @@ describe('api/buf', function()
end)
end)
- describe('{get,set}_name', function()
+ describe('nvim_buf_get_name, nvim_buf_set_name', function()
it('works', function()
nvim('command', 'new')
eq('', curbuf('get_name'))
@@ -438,14 +456,12 @@ describe('api/buf', function()
curbuf('set_name', new_name)
eq(new_name, curbuf('get_name'))
nvim('command', 'w!')
- local f = io.open(new_name)
- ok(f ~= nil)
- f:close()
+ eq(1, funcs.filereadable(new_name))
os.remove(new_name)
end)
end)
- describe('is_loaded', function()
+ describe('nvim_buf_is_loaded', function()
it('works', function()
-- record our buffer number for when we unload it
local bufnr = curbuf('get_number')
@@ -470,7 +486,7 @@ describe('api/buf', function()
end)
end)
- describe('is_valid', function()
+ describe('nvim_buf_is_valid', function()
it('works', function()
nvim('command', 'new')
local b = nvim('get_current_buf')
@@ -480,12 +496,12 @@ describe('api/buf', function()
end)
end)
- describe('get_mark', function()
+ describe('nvim_buf_get_mark', function()
it('works', function()
curbuf('set_lines', -1, -1, true, {'a', 'bit of', 'text'})
curwin('set_cursor', {3, 4})
- nvim('command', 'mark V')
- eq({3, 0}, curbuf('get_mark', 'V'))
+ nvim('command', 'mark v')
+ eq({3, 0}, curbuf('get_mark', 'v'))
end)
end)
end)
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua
index 007d40874f..8f318e3503 100644
--- a/test/functional/lua/overrides_spec.lua
+++ b/test/functional/lua/overrides_spec.lua
@@ -300,3 +300,19 @@ describe('package.path/package.cpath', function()
eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str))
end)
end)
+
+describe('os.getenv', function()
+ it('returns nothing for undefined env var', function()
+ eq(NIL, funcs.luaeval('os.getenv("XTEST_1")'))
+ end)
+ it('returns env var set by the parent process', function()
+ local value = 'foo'
+ clear({env = {['XTEST_1']=value}})
+ eq(value, funcs.luaeval('os.getenv("XTEST_1")'))
+ end)
+ it('returns env var set by let', function()
+ local value = 'foo'
+ meths.command('let $XTEST_1 = "'..value..'"')
+ eq(value, funcs.luaeval('os.getenv("XTEST_1")'))
+ end)
+end)
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 5d112d7f35..16be846647 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -600,6 +600,137 @@ local function test_cmdline(linegrid)
pos = 12,
}}}
end)
+
+ it('works together with ext_popupmenu', function()
+ local expected = {
+ {'define', '', '', ''},
+ {'jump', '', '', ''},
+ {'list', '', '', ''},
+ {'place', '', '', ''},
+ {'undefine', '', '', ''},
+ {'unplace', '', '', ''},
+ }
+
+ command('set wildmode=full')
+ command('set wildmenu')
+ screen:set_option('ext_popupmenu', true)
+ feed(':sign <tab>')
+
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign define"}},
+ pos = 11,
+ }}, popupmenu={items=expected, pos=0, anchor={-1, 0, 5}}}
+
+ feed('<tab>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign jump"}},
+ pos = 9,
+ }}, popupmenu={items=expected, pos=1, anchor={-1, 0, 5}}}
+
+ feed('<left><left>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign "}},
+ pos = 5,
+ }}, popupmenu={items=expected, pos=-1, anchor={-1, 0, 5}}}
+
+ feed('<right>')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign define"}},
+ pos = 11,
+ }}, popupmenu={items=expected, pos=0, anchor={-1, 0, 5}}}
+
+ feed('a')
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign definea"}},
+ pos = 12,
+ }}}
+ feed('<esc>')
+
+ -- check positioning with multibyte char in pattern
+ command("e långfile1")
+ command("sp långfile2")
+ feed(':b lå<tab>')
+ screen:expect{grid=[[
+ ^ |
+ {3:långfile2 }|
+ |
+ {2:långfile1 }|
+ |
+ ]], popupmenu={
+ anchor = { -1, 0, 2 },
+ items = {{ "långfile1", "", "", "" }, { "långfile2", "", "", "" }},
+ pos = 0
+ }, cmdline={{
+ content = {{ "b långfile1" }},
+ firstc = ":",
+ pos = 12
+ }}}
+ end)
+
+ it('ext_wildmenu takes precedence over ext_popupmenu', function()
+ local expected = {
+ 'define',
+ 'jump',
+ 'list',
+ 'place',
+ 'undefine',
+ 'unplace',
+ }
+
+ command('set wildmode=full')
+ command('set wildmenu')
+ screen:set_option('ext_wildmenu', true)
+ screen:set_option('ext_popupmenu', true)
+ feed(':sign <tab>')
+
+ screen:expect{grid=[[
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], cmdline={{
+ firstc = ":",
+ content = {{"sign define"}},
+ pos = 11,
+ }}, wildmenu_items=expected, wildmenu_pos=0}
+ end)
+
end
-- the representation of cmdline and cmdline_block contents changed with ext_linegrid
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 06d3b6bdda..d18d91de56 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -1352,7 +1352,7 @@ describe('floating windows', function()
]], float_pos={
[3] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}, popupmenu={
- anchor = {0, 2, 3}, items = items, pos = 0
+ anchor = {3, 0, 2}, items = items, pos = 0
}}
else
screen:expect{grid=[[
@@ -1364,7 +1364,7 @@ describe('floating windows', function()
{0:~ }{12:~ }{0: }|
{3:-- INSERT --} |
]], popupmenu={
- anchor = {2, 7}, items = items, pos = 0
+ anchor = {1, 2, 7}, items = items, pos = 0
}}
end
@@ -1434,7 +1434,7 @@ describe('floating windows', function()
]], float_pos={
[3] = {{ id = 1001 }, "NW", 1, 2, 5, true},
}, popupmenu={
- anchor = {0, 0, 2}, items = items, pos = 0
+ anchor = {2, 0, 0}, items = items, pos = 0
}}
else
screen:expect{grid=[[
@@ -1446,7 +1446,7 @@ describe('floating windows', function()
{0:~ }{12:~ }{0: }|
{3:-- INSERT --} |
]], popupmenu={
- anchor = {0, 0}, items = items, pos = 0
+ anchor = {1, 0, 0}, items = items, pos = 0
}}
end
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 388c6b3e95..efa776762b 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -179,7 +179,7 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~ }|
]], popupmenu={
- anchor = { 2, 0 },
+ anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
pos = 1
}, showmode={ { "-- Keyword Local completion (^N^P) ", 3 }, { "match 1 of 2", 4 } }}
@@ -194,7 +194,7 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~ }|
]], popupmenu={
- anchor = { 2, 0 },
+ anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
pos = 1
}, messages={ {
@@ -210,7 +210,7 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~ }|
]], popupmenu={
- anchor = { 2, 0 },
+ anchor = { 1, 2, 0 },
items = { { "alphpabet", "", "", "" }, { "alphanum", "", "", "" } },
pos = 0
}, messages={ {
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 1e6ebb87f5..b457ebebab 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -50,7 +50,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=0,
- anchor={1,0},
+ anchor={1,1,0},
}}
feed('<c-p>')
@@ -66,7 +66,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=-1,
- anchor={1,0},
+ anchor={1,1,0},
}}
-- down moves the selection in the menu, but does not insert anything
@@ -83,7 +83,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=1,
- anchor={1,0},
+ anchor={1,1,0},
}}
feed('<cr>')
@@ -113,7 +113,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=0,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(1,false,false,{})
@@ -129,7 +129,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=1,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(2,true,false,{})
@@ -145,7 +145,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=2,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(0,true,true,{})
@@ -174,7 +174,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=0,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(-1,false,false,{})
@@ -190,7 +190,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=-1,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(1,true,false,{})
@@ -206,7 +206,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=1,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(-1,true,false,{})
@@ -222,7 +222,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=-1,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(0,true,false,{})
@@ -238,7 +238,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=0,
- anchor={1,0},
+ anchor={1,1,0},
}}
meths.select_popupmenu_item(-1,true,true,{})
@@ -269,7 +269,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=0,
- anchor={1,0},
+ anchor={1,1,0},
}}
feed('<f1>')
@@ -285,7 +285,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=2,
- anchor={1,0},
+ anchor={1,1,0},
}}
feed('<f2>')
@@ -301,7 +301,7 @@ describe('ui/ext_popupmenu', function()
]], popupmenu={
items=expected,
pos=-1,
- anchor={1,0},
+ anchor={1,1,0},
}}
feed('<f3>')
@@ -366,6 +366,113 @@ describe('ui/ext_popupmenu', function()
{2:-- INSERT --} |
]])
end)
+
+ it('works with wildoptions=pum', function()
+ screen:try_resize(32,10)
+ command('set wildmenu')
+ command('set wildoptions=pum')
+
+ local wild_expected = {
+ {'define', '', '', ''},
+ {'jump', '', '', ''},
+ {'list', '', '', ''},
+ {'place', '', '', ''},
+ {'undefine', '', '', ''},
+ {'unplace', '', '', ''},
+ }
+
+ feed(':sign ')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign ^ |
+ ]])
+
+ feed('<tab>')
+ screen:expect{grid=[[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign define^ |
+ ]], popupmenu={items=wild_expected, pos=0, anchor={1, 9, 6}}}
+
+ feed('<left>')
+ screen:expect{grid=[[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign ^ |
+ ]], popupmenu={items=wild_expected, pos=-1, anchor={1, 9, 6}}}
+
+ feed('<left>')
+ screen:expect{grid=[[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplace^ |
+ ]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}}
+
+ feed('x')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplacex^ |
+ ]])
+ feed('<esc>')
+
+ -- check positioning with multibyte char in pattern
+ command("e långfile1")
+ command("sp långfile2")
+ feed(':b lå<tab>')
+ screen:expect{grid=[[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {4:långfile2 }|
+ |
+ {1:~ }|
+ {1:~ }|
+ {3:långfile1 }|
+ :b långfile1^ |
+ ]], popupmenu={
+ anchor = {1, 9, 3},
+ items = {{"långfile1", "", "", "" }, {"långfile2", "", "", ""}},
+ pos = 0,
+ }}
+ end)
end)
@@ -1209,7 +1316,7 @@ describe('builtin popupmenu', function()
]])
meths.input_mouse('wheel', 'down', '', 0, 6, 15)
- screen:expect([[
+ screen:expect{grid=[[
choice^ |
{1:~ }|
{n:word }{1: }|
@@ -1218,7 +1325,7 @@ describe('builtin popupmenu', function()
{n:thing }{1: }|
{3:[No Name] [+] }|
{2:-- INSERT --} |
- ]])
+ ]], unchanged=true}
end)
it('works with kind, menu and abbr attributes', function()
@@ -1273,6 +1380,131 @@ describe('builtin popupmenu', function()
]])
end)
+ it('works with wildoptions=pum', function()
+ screen:try_resize(32,10)
+ command('set wildmenu')
+ command('set wildoptions=pum')
+
+ feed(':sign ')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign ^ |
+ ]])
+
+ feed('<tab>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }{s: define }{1: }|
+ {1:~ }{n: jump }{1: }|
+ {1:~ }{n: list }{1: }|
+ {1:~ }{n: place }{1: }|
+ {1:~ }{n: undefine }{1: }|
+ {1:~ }{n: unplace }{1: }|
+ :sign define^ |
+ ]])
+
+ feed('<left>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }{n: define }{1: }|
+ {1:~ }{n: jump }{1: }|
+ {1:~ }{n: list }{1: }|
+ {1:~ }{n: place }{1: }|
+ {1:~ }{n: undefine }{1: }|
+ {1:~ }{n: unplace }{1: }|
+ :sign ^ |
+ ]])
+
+ feed('<left>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }{n: define }{1: }|
+ {1:~ }{n: jump }{1: }|
+ {1:~ }{n: list }{1: }|
+ {1:~ }{n: place }{1: }|
+ {1:~ }{n: undefine }{1: }|
+ {1:~ }{s: unplace }{1: }|
+ :sign unplace^ |
+ ]])
+
+ feed('x')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ :sign unplacex^ |
+ ]])
+
+ feed('<esc>')
+
+ -- check positioning with multibyte char in pattern
+ command("e långfile1")
+ command("sp långfile2")
+ feed(':b lå<tab>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {4:långfile2 }|
+ |
+ {1:~ }|
+ {1:~ }{s: långfile1 }{1: }|
+ {3:lå}{n: långfile2 }{3: }|
+ :b långfile1^ |
+ ]])
+
+ -- check doesn't crash on screen resize
+ screen:try_resize(20,6)
+ screen:expect([[
+ |
+ {1:~ }|
+ {4:långfile2 }|
+ {s: långfile1 } |
+ {3:lå}{n: långfile2 }{3: }|
+ :b långfile1^ |
+ ]])
+
+ screen:try_resize(50,15)
+ screen:expect([[
+ |
+ {1:~ }|
+ {4:långfile2 }|
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }{s: långfile1 }{1: }|
+ {3:lå}{n: långfile2 }{3: }|
+ :b långfile1^ |
+ ]])
+ end)
+
it("'pumblend' RGB-color", function()
screen:try_resize(60,14)
screen:set_default_attr_ids({
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 8b1b77eb81..d072444ee1 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -937,10 +937,7 @@ function Screen:_handle_option_set(name, value)
end
function Screen:_handle_popupmenu_show(items, selected, row, col, grid)
- if (not self._options.ext_multigrid) and grid == 1 then
- grid = nil
- end
- self.popupmenu = {items=items, pos=selected, anchor={row, col, grid}}
+ self.popupmenu = {items=items, pos=selected, anchor={grid, row, col}}
end
function Screen:_handle_popupmenu_select(selected)
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 7cd09fb222..cf22bb0a6f 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -29,8 +29,7 @@ describe("'wildmenu'", function()
end
it(':sign <tab> shows wildmenu completions', function()
- command('set wildmode=full')
- command('set wildmenu')
+ command('set wildmenu wildmode=full')
feed(':sign <tab>')
screen:expect([[
|
@@ -201,14 +200,28 @@ 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>')
+ screen:expect([[
+ |
+ {1:~ }|
+ {1:~ }|
+ {2:XTEST_1}{3: XTEST_2 }|
+ :!echo $XTEST_1^ |
+ ]])
+ end)
+
it('completes (multibyte) env var names #9655', function()
clear({env={
['XTEST_1AaあB']='foo',
['XTEST_2']='bar',
}})
screen:attach()
- command('set wildmode=full')
- command('set wildmenu')
+ command('set wildmenu wildmode=full')
feed(':!echo $XTEST_<tab>')
screen:expect([[
|