From b3ea36c5bcb88b6a05a66347eedd461e9385103f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 23 Aug 2020 21:46:32 +0200 Subject: 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) --- src/normal.c | 4 +++- src/testdir/test_vim9_cmd.vim | 20 ++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/normal.c b/src/normal.c index cb8e73636..1ef650924 100644 --- a/src/normal.c +++ b/src/normal.c @@ -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); } } diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 9f4231a9a..9372d9095 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -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! \" + catch /E433/ + caught = 2 + endtry + assert_equal(2, caught) + + try + exe "norm! 3\" + catch /E433/ + caught = 3 + endtry + assert_equal(3, caught) + bwipe! +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 421e4a68c..41e91880c 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1520, /**/ 1519, /**/ -- cgit v1.2.1