From b03b51d27ace58cc17eb8a3aec99fa20dd3209ab Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Mon, 31 Dec 2018 12:40:49 -0500 Subject: Add 'history' and 'uncommitted_modifications' expansions --- src/buffer.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index f7eeee31..c2a04c2e 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -66,7 +66,7 @@ static void apply_options(OptionManager& options, const ParsedLines& parsed_line } Buffer::HistoryNode::HistoryNode(HistoryId parent) - : parent{parent}, timepoint{Clock::now()} + : parent{parent}, committed{Clock::now()} {} Buffer::Buffer(String name, Flags flags, StringView data, @@ -231,20 +231,10 @@ String Buffer::string(BufferCoord begin, BufferCoord end) const return res; } -// A Modification holds a single atomic modification to Buffer -struct Buffer::Modification +Buffer::Modification Buffer::Modification::inverse() const { - enum Type { Insert, Erase }; - - Type type; - BufferCoord coord; - StringDataPtr content; - - Modification inverse() const - { - return {type == Insert ? Erase : Insert, coord, content}; - } -}; + return {type == Insert ? Erase : Insert, coord, content}; +} void Buffer::reload(StringView data, timespec fs_timestamp) { -- cgit v1.2.3