summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-19 22:51:48 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-19 22:51:48 +0000
commitf61c89d2e698e287a9d04c0a29f4ecc0130c2ea2 (patch)
tree81dccba7f2ae6b868dd30b0f14db444b2f3383fb /src/getchar.c
parentbed34f0a8a4e38a72a080184881bc68254a8cdc6 (diff)
patch 8.2.4148: deleting any mapping may cause <ScritpCmd> to failv8.2.4148
Problem: Deleting any mapping may cause <ScritpCmd> to not set the script context. Solution: Only reset last_used_map if it is the deleted mapping. (closes #9568)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/getchar.c b/src/getchar.c
index ff71952316..c0dfc2b0b8 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3836,8 +3836,9 @@ do_cmdkey_command(int key UNUSED, int flags)
#if defined(FEAT_EVAL) || defined(PROTO)
void
-reset_last_used_map(void)
+reset_last_used_map(mapblock_T *mp)
{
- last_used_map = NULL;
+ if (last_used_map == mp)
+ last_used_map = NULL;
}
#endif