Skip to content

Commit b1ba9ab

Browse files
committed
patch 8.1.2168: heredoc assignment not skipped in if block
Problem: Heredoc assignment not skipped in if block. Solution: Check if "skip" is set. (closes #5063)
1 parent 2559a47 commit b1ba9ab

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/evalvars.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,13 @@ ex_let_const(exarg_T *eap, int is_const)
756756
if (l != NULL)
757757
{
758758
rettv_list_set(&rettv, l);
759-
op[0] = '=';
760-
op[1] = NUL;
761-
(void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
759+
if (!eap->skip)
760+
{
761+
op[0] = '=';
762+
op[1] = NUL;
763+
(void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count,
762764
is_const, op);
765+
}
763766
clear_tv(&rettv);
764767
}
765768
}

src/testdir/test_let.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,12 @@ E
295295
app
296296
END
297297
call assert_equal(['something', 'app'], var1)
298+
299+
let check = []
300+
if 0
301+
let check =<< trim END
302+
from heredoc
303+
END
304+
endif
305+
call assert_equal([], check)
298306
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
2168,
756758
/**/
757759
2167,
758760
/**/

0 commit comments

Comments
 (0)