diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-10 22:33:05 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-10 22:33:05 +0300 |
commit | 83f77c80c084a0390b5a6efd364b33620c9f3d10 (patch) | |
tree | dd7b86b1c86022cb43daa13304a2d9322bfe9e28 | |
parent | 5008205a3e1eef61396e457e5091eb1341b98278 (diff) | |
download | rneovim-83f77c80c084a0390b5a6efd364b33620c9f3d10.tar.gz rneovim-83f77c80c084a0390b5a6efd364b33620c9f3d10.tar.bz2 rneovim-83f77c80c084a0390b5a6efd364b33620c9f3d10.zip |
quickfix: Fix :cexpr and :lexpr
-rw-r--r-- | src/nvim/quickfix.c | 2 | ||||
-rw-r--r-- | test/functional/eval/null_spec.lua | 11 |
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() |