diff options
| author | Maxime Coste <mawww@kakoune.org> | 2020-01-02 21:13:43 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2020-01-02 21:13:43 +1100 |
| commit | 43dc494e5cfac649c8f242b940a656adcae906db (patch) | |
| tree | b73d5cbb3e05b4d35b9d3cedc16bc60586c79531 /src/buffer.cc | |
| parent | f2159750d28153b68b244d2bdcc3905e0efa425d (diff) | |
| parent | b03b51d27ace58cc17eb8a3aec99fa20dd3209ab (diff) | |
Merge remote-tracking branch 'eraserhd/history-api'
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 18 |
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) { |
