aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-04-28 15:27:34 -0600
committerGitHub <noreply@github.com>2022-04-28 15:27:34 -0600
commit188537efb32d02081c1821cb5b48fbcf59230732 (patch)
tree1f73c24e8d64fdcbe1b53feb7c856cc6b3e841a2
parent521e91e1c420bd5c94c35908181dbba81e58dd0f (diff)
downloadrneovim-188537efb32d02081c1821cb5b48fbcf59230732.tar.gz
rneovim-188537efb32d02081c1821cb5b48fbcf59230732.tar.bz2
rneovim-188537efb32d02081c1821cb5b48fbcf59230732.zip
fix: suppress "is a directory" messages with shortmess 'F' (#18296)
When 'F' is in 'shortmess', don't show messages when editing a directory. This fixes a regression introduced by 0956283.
-rw-r--r--src/nvim/fileio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 25c99af41b..c5bb9442bc 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -359,7 +359,9 @@ int readfile(char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_ski
// because reading the file may actually work, but then creating the
// swap file may destroy it! Reported on MS-DOS and Win 95.
if (after_pathsep((const char *)fname, (const char *)(fname + namelen))) {
- filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
+ if (!silent) {
+ filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
+ }
msg_end();
msg_scroll = msg_save;
return NOTDONE;
@@ -379,7 +381,9 @@ int readfile(char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_ski
#endif
) {
if (S_ISDIR(perm)) {
- filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
+ if (!silent) {
+ filemess(curbuf, fname, (char_u *)_(msg_is_a_directory), 0);
+ }
} else {
filemess(curbuf, fname, (char_u *)_("is not a file"), 0);
}