1
0
forked from aniani/vim

patch 8.2.2335: Vim9: "silent return" does not restore command modifiers

Problem:    Vim9: "silent return" does not restore command modifiers.
Solution:   Resture command modifiers before returning. (closes #7649)
This commit is contained in:
Bram Moolenaar
2021-01-12 18:58:39 +01:00
parent a0122dcd1c
commit 7cd24227c0
3 changed files with 22 additions and 0 deletions

View File

@@ -2055,6 +2055,7 @@ generate_undo_cmdmods(cctx_T *cctx)
{
if (cctx->ctx_has_cmdmod && generate_instr(cctx, ISN_CMDMOD_REV) == NULL)
return FAIL;
cctx->ctx_has_cmdmod = FALSE;
return OK;
}
@@ -4933,6 +4934,10 @@ compile_return(char_u *arg, int check_return_type, cctx_T *cctx)
// No argument, return zero.
generate_PUSHNR(cctx, 0);
}
// Undo any command modifiers.
generate_undo_cmdmods(cctx);
if (cctx->ctx_skip != SKIP_YES && generate_instr(cctx, ISN_RETURN) == NULL)
return NULL;