diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-13 06:59:30 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-13 11:33:04 -0400 |
commit | e346c01c314bcb8e673cef72dd761b9612ea86db (patch) | |
tree | 5154fc193f4ea25c6eb8366836c5ad5b0e51a7e9 /src/nvim/fileio.c | |
parent | ee5cc88a73401e4352660862631117c8319950f7 (diff) | |
download | rneovim-e346c01c314bcb8e673cef72dd761b9612ea86db.tar.gz rneovim-e346c01c314bcb8e673cef72dd761b9612ea86db.tar.bz2 rneovim-e346c01c314bcb8e673cef72dd761b9612ea86db.zip |
vim-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 vim/vim#3165)
https://github.com/vim/vim/commit/386bc82a3f82f70bad75aaad74dba57a176b5840
Sleep 2 seconds for autoread (https://github.com/neovim/neovim/pull/7592).
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 78fac5acf8..8b650d0d5b 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4892,10 +4892,12 @@ 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 (!file_info_ok) { - 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; } else { |