0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-07-07 18:34:12 +02:00
parent cbbe4ab4b2
commit 386bc82a3f
3 changed files with 57 additions and 9 deletions

View File

@@ -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;
}