summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorJason Felice <jason.m.felice@gmail.com>2018-12-31 12:40:49 -0500
committerJason Felice <jason.m.felice@gmail.com>2020-01-01 19:47:29 -0500
commitb03b51d27ace58cc17eb8a3aec99fa20dd3209ab (patch)
treedc9fa1bcf2d259834f8f31cd4c3c8aac9b816892 /src/buffer.cc
parent62b4780e07e152e037e29823bfd7d911b9767f2e (diff)
Add 'history' and 'uncommitted_modifications' expansions
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc18
1 files changed, 4 insertions, 14 deletions
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)
{