This commit is contained in:
Justin M. Keyes 2016-03-17 00:23:38 -04:00
commit d7511f5cde
6 changed files with 66 additions and 11 deletions

View File

@ -5538,7 +5538,9 @@ A jump table for the options with a short description can be found at |Q_op|.
c don't give |ins-completion-menu| messages. For example, c don't give |ins-completion-menu| messages. For example,
"-- XXX completion (YYY)", "match 1 of 2", "The only match", "-- XXX completion (YYY)", "match 1 of 2", "The only match",
"Pattern not found", "Back at original", etc. "Pattern not found", "Back at original", etc.
q use "recording" instead of "recording @a" q use "recording" instead of "recording @a"
F don't give the file info when editing a file, like `:silent`
was used for the command
This gives you the opportunity to avoid that a change between buffers This gives you the opportunity to avoid that a change between buffers
requires you to hit <Enter>, but still gives as useful a message as requires you to hit <Enter>, but still gives as useful a message as

View File

@ -141,14 +141,21 @@ open_buffer (
/* mark cursor position as being invalid */ /* mark cursor position as being invalid */
curwin->w_valid = 0; curwin->w_valid = 0;
if (curbuf->b_ffname != NULL if (curbuf->b_ffname != NULL) {
) { int old_msg_silent = msg_silent;
if (shortmess(SHM_FILEINFO)) {
msg_silent = 1;
}
retval = readfile(curbuf->b_ffname, curbuf->b_fname, retval = readfile(curbuf->b_ffname, curbuf->b_fname,
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap, (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap,
flags | READ_NEW); flags | READ_NEW);
/* Help buffer is filtered. */ msg_silent = old_msg_silent;
if (curbuf->b_help)
// Help buffer is filtered.
if (curbuf->b_help) {
fix_help_buffer(); fix_help_buffer();
}
} else if (read_stdin) { } else if (read_stdin) {
int save_bin = curbuf->b_p_bin; int save_bin = curbuf->b_p_bin;
linenr_T line_count; linenr_T line_count;

View File

@ -1506,8 +1506,11 @@ void ex_file(exarg_T *eap)
if (rename_buffer(eap->arg) == FAIL) if (rename_buffer(eap->arg) == FAIL)
return; return;
} }
/* print full file name if :cd used */
fileinfo(FALSE, FALSE, eap->forceit); if (!shortmess(SHM_FILEINFO)) {
// print full file name if :cd used
fileinfo(false, false, eap->forceit);
}
} }
/* /*
@ -2483,7 +2486,9 @@ do_ecmd (
msg_scroll = msg_scroll_save; msg_scroll = msg_scroll_save;
msg_scrolled_ign = TRUE; msg_scrolled_ign = TRUE;
fileinfo(FALSE, TRUE, FALSE); if (!shortmess(SHM_FILEINFO)) {
fileinfo(false, true, false);
}
msg_scrolled_ign = FALSE; msg_scrolled_ign = FALSE;
} }

View File

@ -172,6 +172,7 @@ enum {
SHM_INTRO = 'I', ///< Intro messages. SHM_INTRO = 'I', ///< Intro messages.
SHM_COMPLETIONMENU = 'c', ///< Completion menu messages. SHM_COMPLETIONMENU = 'c', ///< Completion menu messages.
SHM_RECORDING = 'q', ///< Short recording message. SHM_RECORDING = 'q', ///< Short recording message.
SHM_FILEINFO = 'F', ///< No file info messages.
}; };
/// Represented by 'a' flag. /// Represented by 'a' flag.
#define SHM_ALL_ABBREVIATIONS ((char_u[]) { \ #define SHM_ALL_ABBREVIATIONS ((char_u[]) { \
@ -183,7 +184,7 @@ enum {
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \ SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \ SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \
SHM_RECORDING, \ SHM_RECORDING, SHM_FILEINFO, \
0, \ 0, \
}) })

View File

@ -69,6 +69,7 @@ static char *features[] = {
// clang-format off // clang-format off
static int included_patches[] = { static int included_patches[] = {
1570,
1511, 1511,
1366, 1366,

View File

@ -0,0 +1,39 @@
local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local clear, feed, execute = helpers.clear, helpers.feed, helpers.execute
describe("'shortmess'", function()
local screen
before_each(function()
clear()
screen = Screen.new(25, 5)
screen:attach()
end)
after_each(function()
screen:detach()
end)
describe('"F" flag', function()
it('hides messages about the files read', function()
execute('e test')
screen:expect([[
^ |
~ |
~ |
~ |
"test" is a directory |
]])
execute('set shortmess=F')
execute('e test')
screen:expect([[
^ |
~ |
~ |
~ |
:e test |
]])
end)
end)
end)