vim-patch:8.2.1631: test_fails() does not check the context of the line number

Problem:    test_fails() does not check the context of the line number.
Solution:   Use another argument to specify the context of the line number.

9bd5d879c2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2022-11-05 12:41:36 +08:00
parent 8ba7a966a1
commit 02f80d9a8a
5 changed files with 28 additions and 11 deletions

View File

@@ -666,6 +666,8 @@ static bool emsg_multiline(const char *s, bool multiline)
if (emsg_assert_fails_used && emsg_assert_fails_msg == NULL) {
emsg_assert_fails_msg = xstrdup(s);
emsg_assert_fails_lnum = SOURCING_LNUM;
xfree(emsg_assert_fails_context);
emsg_assert_fails_context = xstrdup(SOURCING_NAME == NULL ? "" : SOURCING_NAME);
}
// set "v:errmsg", also when using ":silent! cmd"