0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2020-08-23 21:46:32 +02:00
parent c2af0afff5
commit b3ea36c5bc
3 changed files with 25 additions and 1 deletions

View 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);
}
}

View 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

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1520,
/**/
1519,
/**/