diff src/userfunc.c @ 17178:40c4cb095d53 v8.1.1588

patch 8.1.1588: in :let-heredoc line continuation is recognized commit https://github.com/vim/vim/commit/e96a2498f9a2d3e93ac07431f6d4afd77f30afdf Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 25 04:12:16 2019 +0200 patch 8.1.1588: in :let-heredoc line continuation is recognized Problem: In :let-heredoc line continuation is recognized. Solution: Do not consume line continuation. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4580)
author Bram Moolenaar <Bram@vim.org>
date Tue, 25 Jun 2019 04:15:08 +0200
parents 1d30eb64a7a2
children 984eef966002
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2007,6 +2007,7 @@ ex_function(exarg_T *eap)
     hashtab_T	*ht;
     int		todo;
     hashitem_T	*hi;
+    int		do_concat = TRUE;
     int		sourcing_lnum_off;
 
     /*
@@ -2303,9 +2304,9 @@ ex_function(exarg_T *eap)
 	{
 	    vim_free(line_to_free);
 	    if (eap->getline == NULL)
-		theline = getcmdline(':', 0L, indent);
+		theline = getcmdline(':', 0L, indent, do_concat);
 	    else
-		theline = eap->getline(':', eap->cookie, indent);
+		theline = eap->getline(':', eap->cookie, indent, do_concat);
 	    line_to_free = theline;
 	}
 	if (KeyTyped)
@@ -2334,6 +2335,7 @@ ex_function(exarg_T *eap)
 		{
 		    VIM_CLEAR(skip_until);
 		    VIM_CLEAR(trimmed);
+		    do_concat = TRUE;
 		}
 	    }
 	}
@@ -2458,6 +2460,7 @@ ex_function(exarg_T *eap)
 		    skip_until = vim_strsave((char_u *)".");
 		else
 		    skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p));
+		do_concat = FALSE;
 	    }
 	}
 
@@ -3511,7 +3514,8 @@ get_return_cmd(void *rettv)
 get_func_line(
     int	    c UNUSED,
     void    *cookie,
-    int	    indent UNUSED)
+    int	    indent UNUSED,
+    int	    do_concat UNUSED)
 {
     funccall_T	*fcp = (funccall_T *)cookie;
     ufunc_T	*fp = fcp->func;