summaryrefslogtreecommitdiffstats
path: root/src/bufwrite.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-10-14 21:27:55 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-14 21:27:55 +0100
commit0a7984af5601323fae7b3398f05a48087db7b767 (patch)
tree22efd296a4db294d3e9288c5d2085c1a5679ae82 /src/bufwrite.c
parent340dd0fbe462a15a9678cfba02085b4adcc45f02 (diff)
patch 8.2.3510: changes are only detected with one second accuracyv8.2.3510
Problem: Changes are only detected with one second accuracy. Solution: Use the nanosecond time if possible. (Leah Neukirchen, closes #8873, closes #8875)
Diffstat (limited to 'src/bufwrite.c')
-rw-r--r--src/bufwrite.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}
}