diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-02 22:53:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-05-02 22:53:45 +0100 |
commit | db08887f24d20be11d184ce321bc0890613e42bd (patch) | |
tree | 6e9feb7b98be9323db3220951107c1d2edd01d57 /src/typval.c | |
parent | f4f579b46b27f5e1689912a3e84c6a2a96efd143 (diff) |
patch 8.2.4858: K_SPECIAL may be escaped twicev8.2.4858
Problem: K_SPECIAL may be escaped twice.
Solution: Avoid double escaping. (closes #10340)
Diffstat (limited to 'src/typval.c')
-rw-r--r-- | src/typval.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/typval.c b/src/typval.c index 50b1d620a6..4f6e41dfdd 100644 --- a/src/typval.c +++ b/src/typval.c @@ -2069,11 +2069,10 @@ eval_string(char_u **arg, typval_T *rettv, int evaluate) { ++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; } } @@ -2168,7 +2167,7 @@ eval_string(char_u **arg, typval_T *rettv, int evaluate) if (p[1] != '*') flags |= FSK_SIMPLIFY; - extra = trans_special(&p, end, flags, NULL); + extra = trans_special(&p, end, flags, FALSE, NULL); if (extra != 0) { end += extra; |