changeset 17565:0026ea34a8d5 v8.1.1780

patch 8.1.1780: warning for file no longer available is repeated commit https://github.com/vim/vim/commit/674e2bde6e7b0c468f304713aa8f97a45e1fcc89 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 31 20:21:01 2019 +0200 patch 8.1.1780: warning for file no longer available is repeated Problem: Warning for file no longer available is repeated every time Vim is focused. (Brian Armstrong) Solution: Only give the message once. (closes #4748)
author Bram Moolenaar <Bram@vim.org>
date Wed, 31 Jul 2019 20:30:07 +0200
parents 59dcae93845f
children 132008ac886d
files src/fileio.c src/version.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1780,
+/**/
     1779,
 /**/
     1778,