aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-03 06:11:22 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-05-03 06:21:50 +0800
commit27149e0071c3fa38c81526f63a997bedfd6e2be8 (patch)
tree8d819a934bd5c11c7947ff06bea23a609723d078 /src/nvim/eval.c
parentddf7bb24f98b468d2bc6c16c6f300570fc6530f5 (diff)
downloadrneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.tar.gz
rneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.tar.bz2
rneovim-27149e0071c3fa38c81526f63a997bedfd6e2be8.zip
vim-patch:8.2.4858: K_SPECIAL may be escaped twice
Problem: K_SPECIAL may be escaped twice. Solution: Avoid double escaping. (closes vim/vim#10340) https://github.com/vim/vim/commit/db08887f24d20be11d184ce321bc0890613e42bd
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index da869df5cc..3023b1e774 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -4869,11 +4869,10 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
if (*p == '\\' && p[1] != NUL) {
p++;
// A "\<x>" form occupies at least 4 characters, and produces up
- // to 21 characters (3 * 6 for the char and 3 for a modifier):
- // reserve space for 18 extra.
- // Each byte in the char could be encoded as K_SPECIAL K_EXTRA x.
+ // to 9 characters (6 for the char and 3 for a modifier):
+ // reserve space for 5 extra.
if (*p == '<') {
- extra += 18;
+ extra += 5;
}
}
}
@@ -4971,7 +4970,7 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
if (p[1] != '*') {
flags |= FSK_SIMPLIFY;
}
- extra = trans_special((const char_u **)&p, STRLEN(p), name, flags, NULL);
+ extra = trans_special((const char_u **)&p, STRLEN(p), name, flags, false, NULL);
if (extra != 0) {
name += extra;
if (name >= rettv->vval.v_string + len) {