From: Bram Moolenaar Date: Sun, 16 Feb 2020 15:20:21 +0000 (+0100) Subject: patch 8.2.0265: "eval" after "if 0" doesn't check for following command X-Git-Tag: v8.2.0265 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a76b31542e1d83b7d2fe7378439912e800a4d0f6;p=vim 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) --- diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 659af1911..a819f6488 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2375,6 +2375,7 @@ do_one_cmd( case CMD_echoerr: case CMD_echomsg: case CMD_echon: + case CMD_eval: case CMD_execute: case CMD_filter: case CMD_help: diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index bd9cacafa..1281ae72f 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -530,3 +530,12 @@ func Test_broken_number() call assert_equal(2, str2nr('2a')) call assert_fails('inoremap b', 'E474:') endfunc + +func Test_eval_after_if() + let s:val = '' + func SetVal(x) + let s:val ..= a:x + endfunc + if 0 | eval SetVal('a') | endif | call SetVal('b') + call assert_equal('b', s:val) +endfunc diff --git a/src/version.c b/src/version.c index dc849eb45..da0b2f61c 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 265, /**/ 264, /**/