aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-14 20:47:39 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-15 18:30:03 -0400
commiteb93399d702917eaef21aaa91640a6a6983b5d21 (patch)
tree3eb2202e0e015202467821a28b2fb580d07a7d2c
parentb34dc4c458dbec6982c70eed71f0a83c745e46c5 (diff)
downloadrneovim-eb93399d702917eaef21aaa91640a6a6983b5d21.tar.gz
rneovim-eb93399d702917eaef21aaa91640a6a6983b5d21.tar.bz2
rneovim-eb93399d702917eaef21aaa91640a6a6983b5d21.zip
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
-rw-r--r--src/nvim/ex_docmd.c1
-rw-r--r--src/nvim/testdir/test_expr.vim9
2 files changed, 10 insertions, 0 deletions
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