From: Bram Moolenaar Date: Thu, 23 Jul 2020 18:09:10 +0000 (+0200) Subject: patch 8.2.1284: Vim9: skipping over type includes following white space X-Git-Tag: v8.2.1284 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfba8651a51b66fdc52848f32c77aa925586e250;p=vim patch 8.2.1284: Vim9: skipping over type includes following white space Problem: Vim9: skipping over type includes following white space, leading to an error for missing white space. Solution: Do not skip over white space after the type. --- diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 25c40c8b9..c8c6afee0 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -283,6 +283,16 @@ def Test_call_funcref() assert_equal(123, Bar(Funcref)) END CheckScriptSuccess(lines) + + lines =<< trim END + vim9script + def UseNumber(nr: number) + echo nr + enddef + let Funcref: func(number) = function('UseNumber') + Funcref(123) + END + CheckScriptSuccess(lines) enddef let SomeFunc = function('len') diff --git a/src/version.c b/src/version.c index ab410712a..91edd4ad8 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 */ +/**/ + 1284, /**/ 1283, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index 3be8733ea..e032e23a9 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1944,7 +1944,7 @@ skip_type(char_u *start) if (p[1] == ':') p = skip_type(skipwhite(p + 2)); else - p = skipwhite(p + 1); + ++p; } } else