From 0a7984af5601323fae7b3398f05a48087db7b767 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 14 Oct 2021 21:27:55 +0100 Subject: 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 #8873, closes #8875) --- src/bufwrite.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bufwrite.c') diff --git a/src/bufwrite.c b/src/bufwrite.c index a38fb1c0e8..772d707673 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -527,7 +527,7 @@ buf_write_bytes(struct bw_info *ip) check_mtime(buf_T *buf, stat_T *st) { if (buf->b_mtime_read != 0 - && time_differs((long)st->st_mtime, buf->b_mtime_read)) + && time_differs(st, buf->b_mtime_read, buf->b_mtime_read_ns)) { msg_scroll = TRUE; // don't overwrite messages here msg_silent = 0; // must give this prompt @@ -2558,6 +2558,7 @@ nofail: { buf_store_time(buf, &st_old, fname); buf->b_mtime_read = buf->b_mtime; + buf->b_mtime_read_ns = buf->b_mtime_ns; } } } -- cgit v1.2.3