diff src/map.c @ 30007:4123e4bd1708 v9.0.0341

patch 9.0.0341: mapset() does not restore <Nop> mapping properly Commit: https://github.com/vim/vim/commit/92a3d20682d46359bb50a452b4f831659e799155 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Aug 31 16:40:17 2022 +0100 patch 9.0.0341: mapset() does not restore <Nop> mapping properly Problem: mapset() does not restore <Nop> mapping properly. Solution: Use an empty string for <Nop>. (closes https://github.com/vim/vim/issues/11022)
author Bram Moolenaar <Bram@vim.org>
date Wed, 31 Aug 2022 17:45:03 +0200
parents 86eb4aba16c3
children b6b803ed4a53
line wrap: on
line diff
--- a/src/map.c
+++ b/src/map.c
@@ -2658,7 +2658,10 @@ f_mapset(typval_T *argvars, typval_T *re
 	return;
     }
     orig_rhs = rhs;
-    rhs = replace_termcodes(rhs, &arg_buf,
+    if (STRICMP(rhs, "<nop>") == 0)	// "<Nop>" means nothing
+	rhs = (char_u *)"";
+    else
+	rhs = replace_termcodes(rhs, &arg_buf,
 					REPTERM_DO_LT | REPTERM_SPECIAL, NULL);
 
     noremap = dict_get_number(d, "noremap") ? REMAP_NONE: 0;