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 #11022)
diff --git a/src/map.c b/src/map.c
index f870b96..140cbc8 100644
--- a/src/map.c
+++ b/src/map.c
@@ -2658,7 +2658,10 @@
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;