diff --git a/src/evalvars.c b/src/evalvars.c index 2acfc429a5..fbbf57829d 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -2022,7 +2022,7 @@ ex_let_one( void ex_unlet(exarg_T *eap) { - ex_unletlock(eap, eap->arg, 0, 0, do_unlet_var, NULL); + ex_unletlock(eap, eap->arg, 0, eap->forceit ? GLV_QUIET : 0, do_unlet_var, NULL); } /* diff --git a/src/testdir/test_unlet.vim b/src/testdir/test_unlet.vim index 6be963370a..88a293ec6b 100644 --- a/src/testdir/test_unlet.vim +++ b/src/testdir/test_unlet.vim @@ -64,4 +64,16 @@ func Test_unlet_complete() call assert_true(!exists('$FOOBAR') || empty($FOOBAR)) endfunc +func Test_unlet_nonexisting_key() + let g:base = {} + call assert_fails(':unlet g:base["foobar"]', 'E716:') + + try + unlet! g:base["foobar"] + catch + call assert_report("error when unletting non-existing dict key") + endtry + unlet g:base +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 99849aa8b0..5065b15ba1 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1913, /**/ 1912, /**/