aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-13 21:33:28 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-13 21:33:28 +0800
commit03348e5b9db3f057057a70581ef71180c3cb6527 (patch)
treee7a169e48a0a2a06e4cdd0ee0470aeaebbb6ecca /src/nvim/buffer_defs.h
parent6f5fae08a302bce6de453425a6b1c1d851112914 (diff)
downloadrneovim-03348e5b9db3f057057a70581ef71180c3cb6527.tar.gz
rneovim-03348e5b9db3f057057a70581ef71180c3cb6527.tar.bz2
rneovim-03348e5b9db3f057057a70581ef71180c3cb6527.zip
vim-patch:8.2.3510: changes are only detected with one second accuracy
Problem: Changes are only detected with one second accuracy. Solution: Use the nanosecond time if possible. (Leah Neukirchen, closes vim/vim#8873, closes vim/vim#8875) https://github.com/vim/vim/commit/0a7984af5601323fae7b3398f05a48087db7b767 In Nvim Test_checktime_fast() is also flaky. Add a delay to avoid that.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 7b17c5b506..7ae5df164f 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -587,7 +587,9 @@ struct file_buffer {
// where invoked
long b_mtime; // last change time of original file
+ long b_mtime_ns; // nanoseconds of last change time
long b_mtime_read; // last change time when reading
+ long b_mtime_read_ns; // nanoseconds of last read time
uint64_t b_orig_size; // size of original file in bytes
int b_orig_mode; // mode of original file
time_t b_last_used; // time when the buffer was last used; used