diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-02-13 21:58:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-13 21:58:36 +0800 |
commit | 5d6bef0f6e5e6fc2daa12a0d7e1f5d63df59926e (patch) | |
tree | cdecd745052beb1c7fec6840ba52cd51875b1187 /src/nvim/memline.c | |
parent | e4819017480c801c07619bfe740cc934e2f4c85b (diff) | |
parent | b2606673cc367c018527203fbc7c3e85cc9a4e8e (diff) | |
download | rneovim-5d6bef0f6e5e6fc2daa12a0d7e1f5d63df59926e.tar.gz rneovim-5d6bef0f6e5e6fc2daa12a0d7e1f5d63df59926e.tar.bz2 rneovim-5d6bef0f6e5e6fc2daa12a0d7e1f5d63df59926e.zip |
Merge pull request #17374 from zeertzjq/vim-8.2.3510
vim-patch:8.2.{3510,3512,3514,3515,3534}: nanosecond timestamp change detection
Diffstat (limited to 'src/nvim/memline.c')
-rw-r--r-- | src/nvim/memline.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 9925971783..004ef36b36 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -704,11 +704,14 @@ static void set_b0_fname(ZERO_BL *b0p, buf_T *buf) long_to_char((long)os_fileinfo_inode(&file_info), b0p->b0_ino); buf_store_file_info(buf, &file_info); buf->b_mtime_read = buf->b_mtime; + buf->b_mtime_read_ns = buf->b_mtime_ns; } else { long_to_char(0L, b0p->b0_mtime); long_to_char(0L, b0p->b0_ino); buf->b_mtime = 0; + buf->b_mtime_ns = 0; buf->b_mtime_read = 0; + buf->b_mtime_read_ns = 0; buf->b_orig_size = 0; buf->b_orig_mode = 0; } @@ -1720,6 +1723,7 @@ void ml_sync_all(int check_file, int check_char, bool do_fsync) FileInfo file_info; if (!os_fileinfo((char *)buf->b_ffname, &file_info) || file_info.stat.st_mtim.tv_sec != buf->b_mtime_read + || file_info.stat.st_mtim.tv_nsec != buf->b_mtime_read_ns || os_fileinfo_size(&file_info) != buf->b_orig_size) { ml_preserve(buf, false, do_fsync); did_check_timestamps = false; |