]> granicus.if.org Git - vim/commitdiff
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work v8.2.1520
authorBram Moolenaar <Bram@vim.org>
Sun, 23 Aug 2020 19:46:32 +0000 (21:46 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 23 Aug 2020 19:46:32 +0000 (21:46 +0200)
Problem:    Vim9: CTRL-] used in :def function does not work.
Solution:   Omit count or prepend colon. (closes #6769)

src/normal.c
src/testdir/test_vim9_cmd.vim
src/version.c

index cb8e736368dc7e12a7534f67ca987ee081c2d4d6..1ef65092449ff7c80371d341a7dc115f2d94d737 100644 (file)
@@ -3644,8 +3644,10 @@ nv_ident(cmdarg_T *cap)
            {
                if (g_cmd)
                    STRCPY(buf, "tj ");
+               else if (cap->count0 == 0)
+                   STRCPY(buf, "ta ");
                else
-                   sprintf((char *)buf, "%ldta ", cap->count0);
+                   sprintf((char *)buf, ":%ldta ", cap->count0);
            }
     }
 
index 9f4231a9a351b6cd140f56fff1883286b42e1cf5..9372d90952475a6322bd8765cee4c93e63d1d968 100644 (file)
@@ -295,5 +295,25 @@ def Test_map_command()
   CheckScriptSuccess(['vim9script'] + lines)
 enddef
 
+def Test_normal_command()
+  new
+  setline(1, 'doesnotexist')
+  let caught = 0
+  try
+    exe "norm! \<C-]>"
+  catch /E433/
+    caught = 2
+  endtry
+  assert_equal(2, caught)
+
+  try
+    exe "norm! 3\<C-]>"
+  catch /E433/
+    caught = 3
+  endtry
+  assert_equal(3, caught)
+  bwipe!
+enddef
+
 
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
index 421e4a68cfa5cc63132d0e5c245e6d742fc85d46..41e91880cdf58aa26b955b5096e603ddb559c2fe 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1520,
 /**/
     1519,
 /**/