To: vim_dev@googlegroups.com Subject: Patch 8.2.4156 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4156 Problem: Fileinfo message overwrites echo'ed message. Solution: Reset need_fileinfo when displaying a message. (Rob Pilling, closes #9569) Files: src/message.c, src/testdir/test_messages.vim, src/testdir/dumps/Test_fileinfo_after_echo.dump *** ../vim-8.2.4155/src/message.c 2022-01-08 15:39:35.414385257 +0000 --- src/message.c 2022-01-20 14:42:00.577839261 +0000 *************** *** 181,186 **** --- 181,188 ---- < (int)(Rows - cmdline_row - 1) * Columns + sc_col) set_keep_msg((char_u *)s, 0); + need_fileinfo = FALSE; + vim_free(buf); --entered; return retval; *************** *** 1420,1426 **** --- 1422,1431 ---- int did_return = FALSE; if (!msg_silent) + { VIM_CLEAR(keep_msg); + need_fileinfo = FALSE; + } #ifdef FEAT_EVAL if (need_clr_eos) *************** *** 2163,2168 **** --- 2168,2175 ---- msg_puts_printf((char_u *)str, maxlen); else msg_puts_display((char_u *)str, maxlen, attr, FALSE); + + need_fileinfo = FALSE; } /* *** ../vim-8.2.4155/src/testdir/test_messages.vim 2021-12-19 19:19:27.818424761 +0000 --- src/testdir/test_messages.vim 2022-01-20 14:38:49.081215705 +0000 *************** *** 344,347 **** --- 344,378 ---- call assert_equal("function('CountSpaces', [{'ccccccccccc': ['ab', 'cd'], 'aaaaaaaaaaa': v:false, 'bbbbbbbbbbbb': ''}])", string(function('CountSpaces', [#{aaaaaaaaaaa: v:false, bbbbbbbbbbbb: '', ccccccccccc: ['ab', 'cd']}]))) endfunc + " Message output was previously overwritten by the fileinfo display, shown + " when switching buffers. If a buffer is switched to, then a message if + " echoed, we should show the message, rather than overwriting it with + " fileinfo. + func Test_fileinfo_after_echo() + CheckScreendump + + let content =<< trim END + file a.txt + + hide edit b.txt + call setline(1, "hi") + setlocal modified + + hide buffer a.txt + + set updatetime=1 + autocmd CursorHold * b b.txt | w | echo "'b' written" + END + + call writefile(content, 'Xtest_fileinfo_after_echo') + let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6}) + call VerifyScreenDump(buf, 'Test_fileinfo_after_echo', {}) + + call term_sendkeys(buf, ":q\") + + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_fileinfo_after_echo') + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4155/src/testdir/dumps/Test_fileinfo_after_echo.dump 2022-01-20 14:42:32.169269629 +0000 --- src/testdir/dumps/Test_fileinfo_after_echo.dump 2022-01-20 14:38:49.081215705 +0000 *************** *** 0 **** --- 1,6 ---- + >h+0&#ffffff0|i| @72 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |'+0#0000000&|b|'| |w|r|i|t@1|e|n| @45|1|,|1| @10|A|l@1| *** ../vim-8.2.4155/src/version.c 2022-01-20 14:25:50.291988095 +0000 --- src/version.c 2022-01-20 14:42:40.373121164 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4156, /**/ -- When I look deep into your eyes, I see JPEG artifacts. I can tell by the pixels that we're wrong for each other. (xkcd) /// 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 ///