diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-15 06:01:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 06:01:38 +0800 |
commit | 41d6b8a6d060a27a4841af678d6c6b2d111937a2 (patch) | |
tree | 960f05dab800a23e5f98c780f89e91d4ad9b9ad7 | |
parent | f38c05bece0948fcadf943bbf80b9d9672da7059 (diff) | |
download | rneovim-41d6b8a6d060a27a4841af678d6c6b2d111937a2.tar.gz rneovim-41d6b8a6d060a27a4841af678d6c6b2d111937a2.tar.bz2 rneovim-41d6b8a6d060a27a4841af678d6c6b2d111937a2.zip |
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)
https://github.com/vim/vim/commit/28c162f6f1f525882a9a60f10ab4836dee7eb59f
-rw-r--r-- | src/nvim/message.c | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 265585266a..c97e68207b 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -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. diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 6e9f2d2377..fdfc1c0f89 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -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 |