]> granicus.if.org Git - vim/commitdiff
patch 8.2.0265: "eval" after "if 0" doesn't check for following command v8.2.0265
authorBram Moolenaar <Bram@vim.org>
Sun, 16 Feb 2020 15:20:21 +0000 (16:20 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 16 Feb 2020 15:20:21 +0000 (16:20 +0100)
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)

src/ex_docmd.c
src/testdir/test_expr.vim
src/version.c

index 659af19111dcd7af627b55cdd84bacc1c6587e11..a819f64888b52d0ca80176be75453ea1f471b263 100644 (file)
@@ -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:
index bd9cacafa236a9bf6a52c3044f8a263c66e5b247..1281ae72f8ffc5ec06a2e286ef65fb2b093cf495 100644 (file)
@@ -530,3 +530,12 @@ func Test_broken_number()
   call assert_equal(2, str2nr('2a'))
   call assert_fails('inoremap <Char-0b1z> 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
index dc849eb45e72a6080b45f4a66e8755dc22dbc073..da0b2f61c005ab1bd7e952be602db480d9de3010 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    265,
 /**/
     264,
 /**/