summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2019-11-23 15:55:46 +0100
committerFrank LENORMAND <lenormf@gmail.com>2019-12-03 17:05:24 +0100
commite1bd076f5e64010578b904ad4bbb25b462517ef3 (patch)
treedd5bf7dea95a2e58a8342bd0a10c01166232a25a /src/buffer.hh
parent936bd923eae554d83dc77ab788d84b6d83c108f9 (diff)
src: Reload buffers when their contents' hash changes
Instead of triggering a reload event when the timestamp of a buffer's underlying file changes, do so when its contents are actually modified.
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/buffer.hh b/src/buffer.hh
index a586e828..e05ca6d1 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -5,6 +5,7 @@
#include "coord.hh"
#include "constexpr_utils.hh"
#include "enum.hh"
+#include "file.hh"
#include "optional.hh"
#include "safe_ptr.hh"
#include "scope.hh"
@@ -141,9 +142,9 @@ public:
BufferCoord erase(BufferCoord begin, BufferCoord end);
BufferCoord replace(BufferCoord begin, BufferCoord end, StringView content);
- size_t timestamp() const;
- timespec fs_timestamp() const;
- void set_fs_timestamp(timespec ts);
+ size_t timestamp() const;
+ void set_fs_status(FsStatus);
+ const FsStatus& fs_status() const;
void commit_undo_group();
bool undo(size_t count = 1);
@@ -284,7 +285,7 @@ private:
Vector<Change, MemoryDomain::BufferMeta> m_changes;
- timespec m_fs_timestamp;
+ FsStatus m_fs_status;
// Values are just data holding by the buffer, they are not part of its
// observable state