From b9c77e2f09f34985aec83b6f5e5e9dc4b942af2f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 20 Jul 2016 08:50:38 +0100 Subject: [PATCH] Store creation timepoint in HistoryNode --- src/buffer.cc | 4 +++- src/buffer.hh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index 87551c5d..d0a17f74 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -59,7 +59,9 @@ static void apply_options(OptionManager& options, const ParsedLines& parsed_line options.get_local_option("BOM").set(parsed_lines.bom); } -Buffer::HistoryNode::HistoryNode(HistoryNode* parent) : parent(parent) {} +Buffer::HistoryNode::HistoryNode(HistoryNode* parent) + : parent(parent), timepoint{Clock::now()} +{} Buffer::Buffer(String name, Flags flags, StringView data, timespec fs_timestamp) diff --git a/src/buffer.hh b/src/buffer.hh index 2bc1e098..cd136476 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -1,6 +1,7 @@ #ifndef buffer_hh_INCLUDED #define buffer_hh_INCLUDED +#include "clock.hh" #include "coord.hh" #include "flags.hh" #include "safe_ptr.hh" @@ -250,6 +251,7 @@ private: UndoGroup undo_group; Vector, MemoryDomain::BufferMeta> childs; SafePtr redo_child; + TimePoint timepoint; }; HistoryNode m_history;