]> granicus.if.org Git - vim/commitdiff
patch 8.2.4021: missing part of the :import changes v8.2.4021
authorBram Moolenaar <Bram@vim.org>
Thu, 6 Jan 2022 21:38:11 +0000 (21:38 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 6 Jan 2022 21:38:11 +0000 (21:38 +0000)
Problem:    Missing part of the :import changes.
Solution:   Add changes in vim9cmds.c.

src/version.c
src/vim9cmds.c

index d3732cb9c5c858fcbdb156ac6737832c0b38cb77..4a72d01b6da90d1ed159a07b30d375596696b1a0 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4021,
 /**/
     4020,
 /**/
index 2802ac37de6bc717bed90a6c6e810046afd609f7..3372ad42d3bb0f51c95305d1406b7d9267202f27 100644 (file)
@@ -141,17 +141,17 @@ compile_unlet(
        //
        ret = compile_lhs(p, &lhs, CMD_unlet, FALSE, 0, cctx);
 
-       // : unlet an indexed item
-       if (!lhs.lhs_has_index)
+       // Use the info in "lhs" to unlet the item at the index in the
+       // list or dict.
+       if (ret == OK)
        {
-           iemsg("called compile_lhs() without an index");
-           ret = FAIL;
-       }
-       else
-       {
-           // Use the info in "lhs" to unlet the item at the index in the
-           // list or dict.
-           ret = compile_assign_unlet(p, &lhs, FALSE, &t_void, cctx);
+           if (!lhs.lhs_has_index)
+           {
+               semsg(_(e_cannot_unlet_imported_item_str), p);
+               ret = FAIL;
+           }
+           else
+               ret = compile_assign_unlet(p, &lhs, FALSE, &t_void, cctx);
        }
 
        vim_free(lhs.lhs_name);