vim-patch:9.0.0207: stacktrace not shown when debugging (#19776)

Problem:    Stacktrace not shown when debugging.
Solution:   Set msg_scroll in msg_source(). (closes vim/vim#10917)
28c162f6f1
This commit is contained in:
zeertzjq
2022-08-15 06:01:38 +08:00
committed by GitHub
parent f38c05bece
commit 41d6b8a6d0
2 changed files with 9 additions and 5 deletions

View File

@@ -606,6 +606,7 @@ void msg_source(int attr)
}
recursive = true;
msg_scroll = true; // this will take more than one line
no_wait_return++;
char *p = get_emsg_source();
if (p != NULL) {
@@ -739,7 +740,6 @@ static bool emsg_multiline(const char *s, bool multiline)
}
emsg_on_display = true; // remember there is an error message
msg_scroll++; // don't overwrite a previous message
attr = HL_ATTR(HLF_E); // set highlight mode for error messages
if (msg_scrolled != 0) {
need_wait_return = true; // needed in case emsg() is called after
@@ -750,9 +750,8 @@ static bool emsg_multiline(const char *s, bool multiline)
msg_ext_set_kind("emsg");
}
/*
* Display name and line number for the source of the error.
*/
// Display name and line number for the source of the error.
// Sets "msg_scroll".
msg_source(attr);
// Display the error message itself.

View File

@@ -820,11 +820,16 @@ func Test_rightleftcmd()
set rightleft&
endfunc
" Test for the "debug" option
" Test for the 'debug' option
func Test_debug_option()
" redraw to avoid matching previous messages
redraw
set debug=beep
exe "normal \<C-c>"
call assert_equal('Beep!', Screenline(&lines))
call assert_equal('line 4:', Screenline(&lines - 1))
" only match the final colon in the line that shows the source
call assert_match(':$', Screenline(&lines - 2))
set debug&
endfunc