comparison src/testdir/test_messages.vim @ 27255:8c43e3d1a6e5 v8.2.4156

patch 8.2.4156: fileinfo message overwrites echo'ed message Commit: https://github.com/vim/vim/commit/726f7f91fd17e3e7eb39614a20d10ea83c134df0 Author: Rob Pilling <robpilling@gmail.com> Date: Thu Jan 20 14:44:38 2022 +0000 patch 8.2.4156: fileinfo message overwrites echo'ed message Problem: Fileinfo message overwrites echo'ed message. Solution: Reset need_fileinfo when displaying a message. (Rob Pilling, closes #9569)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Jan 2022 15:45:03 +0100
parents a3f38923c037
children 44e82999b4e1
comparison
equal deleted inserted replaced
27254:fb1f1e80407e 27255:8c43e3d1a6e5
342 function CountSpaces() 342 function CountSpaces()
343 endfunction 343 endfunction
344 call assert_equal("function('CountSpaces', [{'ccccccccccc': ['ab', 'cd'], 'aaaaaaaaaaa': v:false, 'bbbbbbbbbbbb': ''}])", string(function('CountSpaces', [#{aaaaaaaaaaa: v:false, bbbbbbbbbbbb: '', ccccccccccc: ['ab', 'cd']}]))) 344 call assert_equal("function('CountSpaces', [{'ccccccccccc': ['ab', 'cd'], 'aaaaaaaaaaa': v:false, 'bbbbbbbbbbbb': ''}])", string(function('CountSpaces', [#{aaaaaaaaaaa: v:false, bbbbbbbbbbbb: '', ccccccccccc: ['ab', 'cd']}])))
345 endfunc 345 endfunc
346 346
347 " Message output was previously overwritten by the fileinfo display, shown
348 " when switching buffers. If a buffer is switched to, then a message if
349 " echoed, we should show the message, rather than overwriting it with
350 " fileinfo.
351 func Test_fileinfo_after_echo()
352 CheckScreendump
353
354 let content =<< trim END
355 file a.txt
356
357 hide edit b.txt
358 call setline(1, "hi")
359 setlocal modified
360
361 hide buffer a.txt
362
363 set updatetime=1
364 autocmd CursorHold * b b.txt | w | echo "'b' written"
365 END
366
367 call writefile(content, 'Xtest_fileinfo_after_echo')
368 let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6})
369 call VerifyScreenDump(buf, 'Test_fileinfo_after_echo', {})
370
371 call term_sendkeys(buf, ":q\<CR>")
372
373 " clean up
374 call StopVimInTerminal(buf)
375 call delete('Xtest_fileinfo_after_echo')
376 endfunc
377
347 " vim: shiftwidth=2 sts=2 expandtab 378 " vim: shiftwidth=2 sts=2 expandtab