]> granicus.if.org Git - vim/commitdiff
patch 8.1.1254: mapping completion contains dead code v8.1.1254
authorBram Moolenaar <Bram@vim.org>
Fri, 3 May 2019 19:10:36 +0000 (21:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 3 May 2019 19:10:36 +0000 (21:10 +0200)
Problem:    Mapping completion contains dead code.
Solution:   Remove the code.

src/term.c
src/testdir/test_cmdline.vim
src/version.c

index 08a55632fb765398b3b6ef7b0ada3e35248fa077..4a39fe3df75f0cecfc7382b86dfad5b72a42f58c 100644 (file)
@@ -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)
index 30a211214c120ac4a4d2529575293a20ba27f01d..91a4b4e8450add3a40db8806a07dbd5ebb817a4e 100644 (file)
@@ -107,9 +107,14 @@ func Test_map_completion()
 
   set cpo+=<
   map <Left> left
+  exe "set t_k6=\<Esc>[17~"
+  call feedkeys(":map \<Esc>[17~x f6x\<CR>", 'xt')
   call feedkeys(":map <L\<Tab>\<Home>\"\<CR>", 'xt')
   call assert_equal('"map <Left>', getreg(':'))
+  call feedkeys(":map \<Esc>[17~\<Tab>\<Home>\"\<CR>", 'xt')
+  call assert_equal("\"map <F6>x", getreg(':'))
   unmap <Left>
+  call feedkeys(":unmap \<Esc>[17~x\<CR>", 'xt')
   set cpo-=<
 
   set cpo+=B
index c166346e6b7ad1361f6e4e22b84d17db4dcdba17..0882fa267a5cd96efc5341c13e00daa55b443cab 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1254,
 /**/
     1253,
 /**/