]> granicus.if.org Git - vim/commitdiff
patch 8.2.2865: skipping over function body fails v8.2.2865
authorBram Moolenaar <Bram@vim.org>
Tue, 18 May 2021 11:40:33 +0000 (13:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 18 May 2021 11:40:33 +0000 (13:40 +0200)
Problem:    Skipping over function body fails.
Solution:   Do not define the function when skipping.

src/userfunc.c
src/version.c

index b88b512c5471ea2a7dc4724516586df3b2cee6cf..bc7d9238439e049aa7c8d51fa28f0d505756c660 100644 (file)
@@ -4014,7 +4014,10 @@ define_function(exarg_T *eap, char_u *name_arg)
     // Save the starting line number.
     sourcing_lnum_top = SOURCING_LNUM;
 
-    if (get_function_body(eap, &newlines, line_arg, &line_to_free) == FAIL)
+    // Do not define the function when getting the body fails and when
+    // skipping.
+    if (get_function_body(eap, &newlines, line_arg, &line_to_free) == FAIL
+           || eap->skip)
        goto erret;
 
     /*
index fb720506517d897f973d7f6bc14399447e1bd104..5e2a52c1a6c331ff0fcd4b861ba7a82c47547878 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2865,
 /**/
     2864,
 /**/