From f61c89d2e698e287a9d04c0a29f4ecc0130c2ea2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 19 Jan 2022 22:51:48 +0000 Subject: patch 8.2.4148: deleting any mapping may cause to fail Problem: Deleting any mapping may cause to not set the script context. Solution: Only reset last_used_map if it is the deleted mapping. (closes #9568) --- src/getchar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/getchar.c') 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 -- cgit v1.2.3