summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-25 04:12:16 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-25 04:12:16 +0200
commite96a2498f9a2d3e93ac07431f6d4afd77f30afdf (patch)
tree9395a92f2de9f49abe63c7fc9f5fe26b1396fb47 /src/ex_cmds2.c
parent2b044ffb5ada77e6fa89779d6532ea9fae3fe029 (diff)
patch 8.1.1588: in :let-heredoc line continuation is recognizedv8.1.1588
Problem: In :let-heredoc line continuation is recognized. Solution: Do not consume line continuation. (Ozaki Kiichi, closes #4580)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 2537e8d7b4..8871f5dbfa 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -371,6 +371,7 @@ check_due_timer(void)
int save_trylevel = trylevel;
int save_did_throw = did_throw;
int save_ex_pressedreturn = get_pressedreturn();
+ int save_may_garbage_collect = may_garbage_collect;
except_T *save_current_exception = current_exception;
vimvars_save_T vvsave;
@@ -385,7 +386,9 @@ check_due_timer(void)
trylevel = 0;
did_throw = FALSE;
current_exception = NULL;
+ may_garbage_collect = FALSE;
save_vimvars(&vvsave);
+
timer->tr_firing = TRUE;
timer_callback(timer);
timer->tr_firing = FALSE;
@@ -407,6 +410,7 @@ check_due_timer(void)
must_redraw = must_redraw > save_must_redraw
? must_redraw : save_must_redraw;
set_pressedreturn(save_ex_pressedreturn);
+ may_garbage_collect = save_may_garbage_collect;
/* Only fire the timer again if it repeats and stop_timer() wasn't
* called while inside the callback (tr_id == -1). */
@@ -3611,7 +3615,7 @@ do_source(
cookie.conv.vc_type = CONV_NONE; /* no conversion */
/* Read the first line so we can check for a UTF-8 BOM. */
- firstline = getsourceline(0, (void *)&cookie, 0);
+ firstline = getsourceline(0, (void *)&cookie, 0, TRUE);
if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef
&& firstline[1] == 0xbb && firstline[2] == 0xbf)
{
@@ -3794,7 +3798,7 @@ free_scriptnames(void)
* Return NULL for end-of-file or some error.
*/
char_u *
-getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
+getsourceline(int c UNUSED, void *cookie, int indent UNUSED, int do_concat)
{
struct source_cookie *sp = (struct source_cookie *)cookie;
char_u *line;
@@ -3833,7 +3837,7 @@ getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
/* Only concatenate lines starting with a \ when 'cpoptions' doesn't
* contain the 'C' flag. */
- if (line != NULL && (vim_strchr(p_cpo, CPO_CONCAT) == NULL))
+ if (line != NULL && do_concat && vim_strchr(p_cpo, CPO_CONCAT) == NULL)
{
/* compensate for the one line read-ahead */
--sourcing_lnum;
@@ -4212,7 +4216,7 @@ do_finish(exarg_T *eap, int reanimate)
*/
int
source_finished(
- char_u *(*fgetline)(int, void *, int),
+ char_u *(*fgetline)(int, void *, int, int),
void *cookie)
{
return (getline_equal(fgetline, cookie, getsourceline)