summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-31 20:21:01 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-31 20:21:01 +0200
commit674e2bde6e7b0c468f304713aa8f97a45e1fcc89 (patch)
tree3d0327fd6214cd182c1deb236069cb9892cf2307 /src/fileio.c
parent8edf0e31323a4293524f51f2960f4f3064309526 (diff)
patch 8.1.1780: warning for file no longer available is repeatedv8.1.1780
Problem: Warning for file no longer available is repeated every time Vim is focused. (Brian Armstrong) Solution: Only give the message once. (closes #4748)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 5e79870adb..1bf4d87607 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6742,6 +6742,8 @@ buf_check_timestamp(
#endif
))
{
+ long prev_b_mtime = buf->b_mtime;
+
retval = 1;
// set b_mtime to stop further warnings (e.g., when executing
@@ -6819,7 +6821,11 @@ buf_check_timestamp(
if (!n)
{
if (*reason == 'd')
- mesg = _("E211: File \"%s\" no longer available");
+ {
+ // Only give the message once.
+ if (prev_b_mtime != -1)
+ mesg = _("E211: File \"%s\" no longer available");
+ }
else
{
helpmesg = TRUE;