From d87c21a918d8d611750f22d68fc638bf7a79b1d5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 18 May 2021 13:40:33 +0200 Subject: patch 8.2.2865: skipping over function body fails Problem: Skipping over function body fails. Solution: Do not define the function when skipping. --- src/userfunc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/userfunc.c') diff --git a/src/userfunc.c b/src/userfunc.c index b88b512c5..bc7d92384 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -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; /* -- cgit v1.2.1