From 61df0c7996d9acc94267735abc214cb176e63ede Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 3 May 2019 21:10:36 +0200 Subject: [PATCH] patch 8.1.1254: mapping completion contains dead code Problem: Mapping completion contains dead code. Solution: Remove the code. --- src/term.c | 18 ------------------ src/testdir/test_cmdline.vim | 5 +++++ src/version.c | 2 ++ 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/term.c b/src/term.c index 08a55632f..4a39fe3df 100644 --- a/src/term.c +++ b/src/term.c @@ -6649,7 +6649,6 @@ translate_mapping(char_u *str) int modifiers; int cpo_bslash; int cpo_special; - int cpo_keycode; ga_init(&ga); ga.ga_itemsize = 1; @@ -6657,7 +6656,6 @@ translate_mapping(char_u *str) cpo_bslash = (vim_strchr(p_cpo, CPO_BSLASH) != NULL); cpo_special = (vim_strchr(p_cpo, CPO_SPECI) != NULL); - cpo_keycode = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL); for (; *str; ++str) { @@ -6671,22 +6669,6 @@ translate_mapping(char_u *str) modifiers = *++str; c = *++str; } - if (cpo_special && cpo_keycode && c == K_SPECIAL && !modifiers) - { - int i; - - /* try to find special key in termcodes */ - for (i = 0; i < tc_len; ++i) - if (termcodes[i].name[0] == str[1] - && termcodes[i].name[1] == str[2]) - break; - if (i < tc_len) - { - ga_concat(&ga, termcodes[i].code); - str += 2; - continue; /* for (str) */ - } - } if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL) { if (cpo_special) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 30a211214..91a4b4e84 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -107,9 +107,14 @@ func Test_map_completion() set cpo+=< map left + exe "set t_k6=\[17~" + call feedkeys(":map \[17~x f6x\", 'xt') call feedkeys(":map \\"\", 'xt') call assert_equal('"map ', getreg(':')) + call feedkeys(":map \[17~\\\"\", 'xt') + call assert_equal("\"map x", getreg(':')) unmap + call feedkeys(":unmap \[17~x\", 'xt') set cpo-=< set cpo+=B diff --git a/src/version.c b/src/version.c index c166346e6..0882fa267 100644 --- a/src/version.c +++ b/src/version.c @@ -767,6 +767,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1254, /**/ 1253, /**/ -- 2.40.0