summaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-31 16:40:17 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-31 16:40:17 +0100
commit92a3d20682d46359bb50a452b4f831659e799155 (patch)
treeeb8d9cc28b75816f7b47b5ae511514f3aaf66502 /src/map.c
parenta2a8973e51a0052bb52e43a2b22e7ecdecc32003 (diff)
patch 9.0.0341: mapset() does not restore <Nop> mapping properlyv9.0.0341
Problem: mapset() does not restore <Nop> mapping properly. Solution: Use an empty string for <Nop>. (closes #11022)
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map.c b/src/map.c
index f870b96831..140cbc84f8 100644
--- a/src/map.c
+++ b/src/map.c
@@ -2658,7 +2658,10 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED)
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;