]> granicus.if.org Git - vim/commitdiff
patch 8.1.1780: warning for file no longer available is repeated v8.1.1780
authorBram Moolenaar <Bram@vim.org>
Wed, 31 Jul 2019 18:21:01 +0000 (20:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 31 Jul 2019 18:21:01 +0000 (20:21 +0200)
Problem:    Warning for file no longer available is repeated every time Vim is
            focused. (Brian Armstrong)
Solution:   Only give the message once. (closes #4748)

src/fileio.c
src/version.c

index 5e79870adb581b2ba8cc16f18f5971a4aa7308ef..1bf4d876073b3da973f6963692b8a3fabab2529f 100644 (file)
@@ -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;
index 463456b4c0c03d57ba401a557db3fdd2537dd73d..15577e0fc1ba68b81596d91ea014a0c2f7870b83 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1780,
 /**/
     1779,
 /**/