diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-16 13:30:33 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-16 13:30:33 +0000 |
commit | a9725221ac4650b7e9219bf6e3682826fe2e0096 (patch) | |
tree | 893ca68160127bb366bf61a6795cd60d55ed51b3 /src/getchar.c | |
parent | fa1a45705995f16ee7e69434c772107a3ddeeebd (diff) |
patch 8.2.4107: script context not restored after using <ScriptCmd>v8.2.4107
Problem: Script context not restored after using <ScriptCmd>.
Solution: Also restore context when not in a script. (closes #9536)
Add the 'c' flag to feedkeys() to be able to test this.
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/getchar.c b/src/getchar.c index ec9cfae189..ff71952316 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3797,7 +3797,7 @@ getcmdkeycmd( } } else - ga_append(&line_ga, (char)c1); + ga_append(&line_ga, c1); cmod = 0; } @@ -3815,7 +3815,7 @@ do_cmdkey_command(int key UNUSED, int flags) { int res; #ifdef FEAT_EVAL - sctx_T save_current_sctx = {0, 0, 0, 0}; + sctx_T save_current_sctx = {-1, 0, 0, 0}; if (key == K_SCRIPT_COMMAND && last_used_map != NULL) { @@ -3827,7 +3827,7 @@ do_cmdkey_command(int key UNUSED, int flags) res = do_cmdline(NULL, getcmdkeycmd, NULL, flags); #ifdef FEAT_EVAL - if (save_current_sctx.sc_sid > 0) + if (save_current_sctx.sc_sid >= 0) current_sctx = save_current_sctx; #endif |