mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
eval: Fix inputlist()
This commit is contained in:
@@ -11254,7 +11254,7 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
int selected;
|
||||
int mouse_used;
|
||||
|
||||
if (argvars[0].v_type != VAR_LIST || argvars[0].vval.v_list == NULL) {
|
||||
if (argvars[0].v_type != VAR_LIST) {
|
||||
EMSG2(_(e_listarg), "inputlist()");
|
||||
return;
|
||||
}
|
||||
|
@@ -42,9 +42,6 @@ describe('NULL', function()
|
||||
describe('list', function()
|
||||
-- Incorrect behaviour
|
||||
|
||||
-- FIXME should be accepted by inputlist()
|
||||
null_expr_test('is accepted as an empty list by inputlist()',
|
||||
'[feedkeys("\\n"), inputlist(L)]', 'E686: Argument of inputlist() must be a List', {0, 0})
|
||||
-- FIXME should be accepted by writefile(), return {0, {}}
|
||||
null_expr_test('is accepted as an empty list by writefile()',
|
||||
('[writefile(L, "%s"), readfile("%s")]'):format(tmpfname, tmpfname),
|
||||
@@ -106,6 +103,7 @@ describe('NULL', function()
|
||||
null_expr_test('makes map() return v:_null_list', 'map(L, "v:val") is# L', 0, 1)
|
||||
null_expr_test('makes filter() return v:_null_list', 'filter(L, "1") is# L', 0, 1)
|
||||
null_test('is treated by :let as empty list', ':let [l] = L', 'Vim(let):E688: More targets than List items')
|
||||
null_expr_test('is accepted as an empty list by inputlist()', '[feedkeys("\\n"), inputlist(L)]', 0, 0)
|
||||
-- FIXME fix test results
|
||||
null_expr_test('does not crash add()', 'add(L, 0)', 0, 1)
|
||||
null_expr_test('makes insert() error out', 'insert(L, 1)', '', nil)
|
||||
|
Reference in New Issue
Block a user