diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-05-22 20:01:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-05-22 20:01:06 +0200 |
commit | c94c1467b9b86156a6b7c8d3e41ff01c13d2be07 (patch) | |
tree | f74f53c6d79e92faabcf3823e111d80bffa56c9e /src/map.c | |
parent | 9cdcd1d0dc3bbea41b731639fd2431c2ef5cffaa (diff) | |
download | vim-git-c94c1467b9b86156a6b7c8d3e41ff01c13d2be07.tar.gz |
patch 8.2.0812: mapset() does not properly handle <> notationv8.2.0812
Problem: mapset() does not properly handle <> notation.
Solution: Convert <> codes. (closes #6116)
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2269,6 +2269,8 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED) dict_T *d; char_u *lhs; char_u *rhs; + char_u *orig_rhs; + char_u *arg_buf = NULL; int noremap; int expr; int silent; @@ -2304,6 +2306,9 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED) emsg(_("E99: rhs entry missing in mapset() dict argument")); return; } + orig_rhs = rhs; + rhs = replace_termcodes(rhs, &arg_buf, + REPTERM_DO_LT | REPTERM_SPECIAL, NULL); noremap = dict_get_number(d, (char_u *)"noremap") ? REMAP_NONE: 0; if (dict_get_number(d, (char_u *)"script") != 0) @@ -2330,9 +2335,10 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED) keys = replace_termcodes(lhs, &keys_buf, REPTERM_FROM_PART | REPTERM_DO_LT, NULL); - (void)map_add(map_table, abbr_table, keys, rhs, rhs, noremap, + (void)map_add(map_table, abbr_table, keys, rhs, orig_rhs, noremap, nowait, silent, mode, is_abbr, expr, sid, lnum, simplified); vim_free(keys_buf); + vim_free(arg_buf); } #endif |