aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/fileio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 907e6c978a..82cf79722e 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4840,6 +4840,8 @@ buf_check_timestamp(
|| time_differs(file_info.stat.st_mtim.tv_sec, buf->b_mtime)
|| (int)file_info.stat.st_mode != buf->b_orig_mode
)) {
+ const long prev_b_mtime = buf->b_mtime;
+
retval = 1;
// set b_mtime to stop further warnings (e.g., when executing
@@ -4903,9 +4905,12 @@ buf_check_timestamp(
return 2;
}
if (!n) {
- if (*reason == 'd')
- mesg = _("E211: File \"%s\" no longer available");
- else {
+ if (*reason == 'd') {
+ // Only give the message once.
+ if (prev_b_mtime != -1) {
+ mesg = _("E211: File \"%s\" no longer available");
+ }
+ } else {
helpmesg = TRUE;
can_reload = TRUE;
/*