0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1183: assert_fails() checks the last error message

Problem:    assert_fails() checks the last error message.
Solution:   Check the first error, it is more relevant.  Fix all the tests
            that rely on the old behavior.
This commit is contained in:
Bram Moolenaar
2020-07-11 22:14:59 +02:00
parent 914e7eaa67
commit 9b7bf9e98f
53 changed files with 225 additions and 152 deletions

View File

@@ -3388,7 +3388,7 @@ static char_u *redir_varname = NULL;
int
var_redir_start(char_u *name, int append)
{
int save_emsg;
int called_emsg_before;
int err;
typval_T tv;
@@ -3432,8 +3432,7 @@ var_redir_start(char_u *name, int append)
// check if we can write to the variable: set it to or append an empty
// string
save_emsg = did_emsg;
did_emsg = FALSE;
called_emsg_before = called_emsg;
tv.v_type = VAR_STRING;
tv.vval.v_string = (char_u *)"";
if (append)
@@ -3441,9 +3440,7 @@ var_redir_start(char_u *name, int append)
else
set_var_lval(redir_lval, redir_endp, &tv, TRUE, 0, (char_u *)"=");
clear_lval(redir_lval);
err = did_emsg;
did_emsg |= save_emsg;
if (err)
if (called_emsg > called_emsg_before)
{
redir_endp = NULL; // don't store a value, only cleanup
var_redir_stop();