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)
a76b31542e
This commit is contained in:
Jan Edmund Lazo 2021-04-14 20:47:39 -04:00
parent b34dc4c458
commit eb93399d70
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 10 additions and 0 deletions

View File

@ -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:

View File

@ -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