aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--test/functional/eval/null_spec.lua11
2 files changed, 4 insertions, 9 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 56d11c21ab..a4dc9c68ce 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -4403,7 +4403,7 @@ void ex_cexpr(exarg_T *eap)
typval_T tv;
if (eval0(eap->arg, &tv, NULL, true) != FAIL) {
if ((tv.v_type == VAR_STRING && tv.vval.v_string != NULL)
- || (tv.v_type == VAR_LIST && tv.vval.v_list != NULL)) {
+ || tv.v_type == VAR_LIST) {
if (qf_init_ext(qi, NULL, NULL, &tv, p_efm,
(eap->cmdidx != CMD_caddexpr
&& eap->cmdidx != CMD_laddexpr),
diff --git a/test/functional/eval/null_spec.lua b/test/functional/eval/null_spec.lua
index 30c6d3d450..3f3217649b 100644
--- a/test/functional/eval/null_spec.lua
+++ b/test/functional/eval/null_spec.lua
@@ -40,14 +40,6 @@ describe('NULL', function()
end)
end
describe('list', function()
- -- Incorrect behaviour
-
- -- FIXME should not error out
- null_test('is accepted by :cexpr', 'cexpr L', 'Vim(cexpr):E777: String or List expected')
- -- FIXME should not error out
- null_test('is accepted by :lexpr', 'lexpr L', 'Vim(lexpr):E777: String or List expected')
- null_test('is accepted by :for', 'for x in L|throw x|endfor', 0)
-
-- Subjectable behaviour
-- FIXME Should return 1
@@ -58,6 +50,7 @@ describe('NULL', function()
null_expr_test('is not locked', 'islocked("v:_null_list")', 0, 0)
-- Correct behaviour
+ null_test('is accepted by :for', 'for x in L|throw x|endfor', 0)
null_expr_test('does not crash append()', 'append(1, L)', 0, 0, function()
eq({''}, curbufmeths.get_lines(0, -1, false))
end)
@@ -126,6 +119,8 @@ describe('NULL', function()
null_expr_test('is accepted by setmatches()', 'setmatches(L)', 0, 0)
null_expr_test('is accepted by setqflist()', 'setqflist(L)', 0, 0)
null_expr_test('is accepted by setloclist()', 'setloclist(1, L)', 0, 0)
+ null_test('is accepted by :cexpr', 'cexpr L', 0)
+ null_test('is accepted by :lexpr', 'lexpr L', 0)
end)
describe('dict', function()
it('does not crash when indexing NULL dict', function()