diff src/fileio.c @ 14290:977cab3d5474 v8.1.0161

patch 8.1.0161: buffer not updated with 'autoread' set if file was deleted commit https://github.com/vim/vim/commit/386bc82a3f82f70bad75aaad74dba57a176b5840 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 7 18:34:12 2018 +0200 patch 8.1.0161: buffer not updated with 'autoread' set if file was deleted Problem: Buffer not updated with 'autoread' set if file was deleted. (Michael Naumann) Solution: Don't set the timestamp to zero. (closes #3165)
author Christian Brabandt <cb@256bit.org>
date Sat, 07 Jul 2018 18:45:06 +0200
parents 3c05b52ffad8
children 4a94173743d9
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6923,11 +6923,13 @@ buf_check_timestamp(
     {
 	retval = 1;
 
-	/* set b_mtime to stop further warnings (e.g., when executing
-	 * FileChangedShell autocmd) */
+	// set b_mtime to stop further warnings (e.g., when executing
+	// FileChangedShell autocmd)
 	if (stat_res < 0)
 	{
-	    buf->b_mtime = 0;
+	    // When 'autoread' is set we'll check the file again to see if it
+	    // re-appears.
+	    buf->b_mtime = buf->b_p_ar;
 	    buf->b_orig_size = 0;
 	    buf->b_orig_mode = 0;
 	}