close_buffer(NULL, buf, action, FALSE, FALSE);
if (!close_others)
need_fileinfo = FALSE;
+ else if (retval == OK && !shortmess(SHM_FILEINFO))
+ // do_ecmd() does not display file info for a new empty buffer.
+ need_fileinfo = TRUE;
return retval;
}
call StopVimInTerminal(buf)
endfunc
+" Test that fileinfo is shown after deleting the last listed buffer with :bd
+func Test_fileinfo_after_last_bd()
+ CheckRunVimInTerminal
+
+ let content =<< trim END
+ set shortmess-=F
+ edit xxx
+ edit yyy
+ END
+
+ call writefile(content, 'Xtest_fileinfo_last_bd', 'D')
+ let buf = RunVimInTerminal('-S Xtest_fileinfo_last_bd', #{rows: 10})
+ call WaitForAssert({-> assert_match('^"yyy" \[New\]', term_getline(buf, 10))})
+
+ call term_sendkeys(buf, ":bd\<CR>")
+ call WaitForAssert({-> assert_match('^"xxx" \[New\]', term_getline(buf, 10))})
+
+ call term_sendkeys(buf, ":bd\<CR>")
+ call WaitForAssert({-> assert_match('^\"\[No Name\]\" --No lines in buffer--', term_getline(buf, 10))})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab