Skip to content

Commit a76b315

Browse files
committed
patch 8.2.0265: "eval" after "if 0" doesn't check for following command
Problem: "eval" after "if 0" doesn't check for following command. Solution: Add "eval" to list of commands that check for a following command. (closes #5640)
1 parent a36c830 commit a76b315

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,7 @@ do_one_cmd(
23752375
case CMD_echoerr:
23762376
case CMD_echomsg:
23772377
case CMD_echon:
2378+
case CMD_eval:
23782379
case CMD_execute:
23792380
case CMD_filter:
23802381
case CMD_help:

src/testdir/test_expr.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,12 @@ func Test_broken_number()
530530
call assert_equal(2, str2nr('2a'))
531531
call assert_fails('inoremap <Char-0b1z> b', 'E474:')
532532
endfunc
533+
534+
func Test_eval_after_if()
535+
let s:val = ''
536+
func SetVal(x)
537+
let s:val ..= a:x
538+
endfunc
539+
if 0 | eval SetVal('a') | endif | call SetVal('b')
540+
call assert_equal('b', s:val)
541+
endfunc

src/version.c

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

743743
static int included_patches[] =
744744
{ /* Add new patch number below this line */
745+
/**/
746+
265,
745747
/**/
746748
264,
747749
/**/

0 commit comments

Comments
 (0)