summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-01-02 21:13:43 +1100
committerMaxime Coste <mawww@kakoune.org>2020-01-02 21:13:43 +1100
commit43dc494e5cfac649c8f242b940a656adcae906db (patch)
treeb73d5cbb3e05b4d35b9d3cedc16bc60586c79531 /src/buffer.cc
parentf2159750d28153b68b244d2bdcc3905e0efa425d (diff)
parentb03b51d27ace58cc17eb8a3aec99fa20dd3209ab (diff)
Merge remote-tracking branch 'eraserhd/history-api'
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)
{