To: vim_dev@googlegroups.com Subject: Patch 9.0.0356 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0356 Problem: :echowindow sets the in_echowindow flag too early. Solution: Set in_echowindow only when outputting the text. (Yasuhiro Matsumoto, closes #11033) Files: src/eval.c, src/testdir/test_messages.vim, src/testdir/dumps/Test_echowin_eval.dump *** ../vim-9.0.0355/src/eval.c 2022-09-01 16:42:59.931897217 +0100 --- src/eval.c 2022-09-02 12:07:51.753967330 +0100 *************** *** 6728,6737 **** long start_lnum = SOURCING_LNUM; ga_init2(&ga, 1, 80); - #ifdef HAS_MESSAGE_WINDOW - if (eap->cmdidx == CMD_echowindow) - start_echowindow(); - #endif if (eap->skip) ++emsg_skip; --- 6728,6733 ---- *************** *** 6796,6806 **** msg_sb_eol(); } ! if (eap->cmdidx == CMD_echomsg || eap->cmdidx == CMD_echowindow) { msg_attr(ga.ga_data, echo_attr); out_flush(); } else if (eap->cmdidx == CMD_echoconsole) { ui_write(ga.ga_data, (int)STRLEN(ga.ga_data), TRUE); --- 6792,6812 ---- msg_sb_eol(); } ! if (eap->cmdidx == CMD_echomsg) { msg_attr(ga.ga_data, echo_attr); out_flush(); } + else if (eap->cmdidx == CMD_echowindow) + { + #ifdef HAS_MESSAGE_WINDOW + start_echowindow(); + #endif + msg_attr(ga.ga_data, echo_attr); + #ifdef HAS_MESSAGE_WINDOW + end_echowindow(); + #endif + } else if (eap->cmdidx == CMD_echoconsole) { ui_write(ga.ga_data, (int)STRLEN(ga.ga_data), TRUE); *************** *** 6832,6841 **** if (eap->skip) --emsg_skip; - #ifdef HAS_MESSAGE_WINDOW - if (eap->cmdidx == CMD_echowindow) - end_echowindow(); - #endif set_nextcmd(eap, arg); } --- 6838,6843 ---- *** ../vim-9.0.0355/src/testdir/test_messages.vim 2022-09-01 16:42:59.931897217 +0100 --- src/testdir/test_messages.vim 2022-09-02 12:14:11.616951296 +0100 *************** *** 420,424 **** --- 420,444 ---- call delete('XtestEchowindow') endfunc + " messages window should not be used while evaluating the :echowin argument + func Test_echowin_eval() + CheckScreendump + + let lines =<< trim END + func ShowMessage() + echo 123 + return 'test' + endfunc + echowindow ShowMessage() + END + call writefile(lines, 'XtestEchowindow') + let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8}) + call VerifyScreenDump(buf, 'Test_echowin_eval', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestEchowindow') + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0355/src/testdir/dumps/Test_echowin_eval.dump 2022-09-02 12:15:48.632741735 +0100 --- src/testdir/dumps/Test_echowin_eval.dump 2022-09-02 12:06:14.566299858 +0100 *************** *** 0 **** --- 1,8 ---- + > +0&#ffffff0@74 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |═+0#e000002&@74 + |t|e|s|t| @70 + |1+0#0000000&|2|3| @53|0|,|0|-|1| @8|A|l@1| *** ../vim-9.0.0355/src/version.c 2022-09-02 11:25:34.074117570 +0100 --- src/version.c 2022-09-02 12:06:48.714178572 +0100 *************** *** 709,710 **** --- 709,712 ---- { /* Add new patch number below this line */ + /**/ + 356, /**/ -- Never under any circumstances take a sleeping pill and a laxative on the same night. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///