Skip to content

Commit b3ea36c

Browse files
committed
patch 8.2.1520: Vim9: CTRL-] used in :def function does not work
Problem: Vim9: CTRL-] used in :def function does not work. Solution: Omit count or prepend colon. (closes #6769)
1 parent c2af0af commit b3ea36c

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/normal.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3644,8 +3644,10 @@ nv_ident(cmdarg_T *cap)
36443644
{
36453645
if (g_cmd)
36463646
STRCPY(buf, "tj ");
3647+
else if (cap->count0 == 0)
3648+
STRCPY(buf, "ta ");
36473649
else
3648-
sprintf((char *)buf, "%ldta ", cap->count0);
3650+
sprintf((char *)buf, ":%ldta ", cap->count0);
36493651
}
36503652
}
36513653

src/testdir/test_vim9_cmd.vim

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,5 +295,25 @@ def Test_map_command()
295295
CheckScriptSuccess(['vim9script'] + lines)
296296
enddef
297297

298+
def Test_normal_command()
299+
new
300+
setline(1, 'doesnotexist')
301+
let caught = 0
302+
try
303+
exe "norm! \<C-]>"
304+
catch /E433/
305+
caught = 2
306+
endtry
307+
assert_equal(2, caught)
308+
309+
try
310+
exe "norm! 3\<C-]>"
311+
catch /E433/
312+
caught = 3
313+
endtry
314+
assert_equal(3, caught)
315+
bwipe!
316+
enddef
317+
298318

299319
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1520,
757759
/**/
758760
1519,
759761
/**/

0 commit comments

Comments
 (0)