diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-07 18:34:12 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-07 18:34:12 +0200 |
commit | 386bc82a3f82f70bad75aaad74dba57a176b5840 (patch) | |
tree | 177a917fd9287fd0c92e74607b85bb42d1ad4fde /src/fileio.c | |
parent | cbbe4ab4b27a2060506fcd2427aed8d8fbff1a21 (diff) | |
download | vim-git-386bc82a3f82f70bad75aaad74dba57a176b5840.tar.gz |
patch 8.1.0161: buffer not updated with 'autoread' set if file was deletedv8.1.0161
Problem: Buffer not updated with 'autoread' set if file was deleted.
(Michael Naumann)
Solution: Don't set the timestamp to zero. (closes #3165)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 0c56a1ef0..07b241ece 100644 --- 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; } |