From eb93399d702917eaef21aaa91640a6a6983b5d21 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 14 Apr 2021 20:47:39 -0400 Subject: 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 vim/vim#5640) https://github.com/vim/vim/commit/a76b31542e1d83b7d2fe7378439912e800a4d0f6 --- src/nvim/ex_docmd.c | 1 + src/nvim/testdir/test_expr.vim | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index d1eddfc74f..ae5c334592 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1857,6 +1857,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, 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/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 09d79979ce..0b41a1127a 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -501,3 +501,12 @@ func Test_empty_concatenate() call assert_equal('b', 'a'[4:0] . 'b') call assert_equal('b', 'b' . 'a'[4:0]) 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 -- cgit