From 03c74b7a885ab116ed88907d98bf3e314e019cc1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 15 Oct 2013 18:51:31 +0100 Subject: Detect file external modification and ask the user whether to reload or not * Buffer now store a m_fs_timestamp field. * Client in Normal mode checks current buffer file every 500 ms, or each time it goes back to Normal mode. --- src/buffer.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index 770be530..0470884d 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -708,4 +708,16 @@ char Buffer::byte_at(BufferCoord c) const return m_lines[c.line].content[c.column]; } +time_t Buffer::fs_timestamp() const +{ + kak_assert(m_flags & Flags::File); + return m_fs_timestamp; +} + +void Buffer::set_fs_timestamp(time_t ts) +{ + kak_assert(m_flags & Flags::File); + m_fs_timestamp = ts; +} + } -- cgit v1.2.3