diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-14 14:27:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-14 14:27:30 +0200 |
commit | b521766c56c0e17db6e8615f35cf21012af0670c (patch) | |
tree | f443c04d8be083e6229a6b61344ac66df4588d5e | |
parent | 88c89c77229e725ab2613b022249e2f506d82b82 (diff) | |
download | vim-git-8.2.3342.tar.gz |
patch 8.2.3342: test for :let errors failsv8.2.3342
Problem: Test for :let errors fails.
Solution: Adjust the test and how to avoid a second error message.
-rw-r--r-- | src/evalvars.c | 3 | ||||
-rw-r--r-- | src/testdir/test_let.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 86a669404..3dc30e92b 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -1184,6 +1184,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first) char_u *arg_subsc; char_u *tofree; typval_T tv; + int prev_uncaught_emsg = uncaught_emsg; while (!ends_excmd2(eap->cmd, arg) && !got_int) { @@ -1193,7 +1194,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first) if (!VIM_ISWHITE(*arg) && !ends_excmd(*arg)) { emsg_severe = TRUE; - if (!error) + if (uncaught_emsg == prev_uncaught_emsg) semsg(_(e_trailing_arg), arg); break; } diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim index d001d0578..5f8879b7e 100644 --- a/src/testdir/test_let.vim +++ b/src/testdir/test_let.vim @@ -279,7 +279,7 @@ func Test_let_errors() let l = [1, 2, 3] call assert_fails('let l[:] = 5', 'E709:') - call assert_fails('let x:lnum=5', ['E121:', 'E488:']) + call assert_fails('let x:lnum=5', ['E121:', 'E121:']) call assert_fails('let v:=5', 'E461:') call assert_fails('let [a]', 'E474:') call assert_fails('let [a, b] = [', 'E697:') diff --git a/src/version.c b/src/version.c index e49611216..71633d741 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3342, +/**/ 3341, /**/ 3340, |