diff --git a/src/buffer.cc b/src/buffer.cc index 620cce3f..62cefef7 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -196,6 +196,13 @@ bool Buffer::redo() return true; } +void Buffer::reset_undo_data() +{ + m_history.clear(); + m_history_cursor = m_history.end(); + m_current_undo_group.clear(); +} + void Buffer::check_invariant() const { BufferSize start = 0; diff --git a/src/buffer.hh b/src/buffer.hh index 5f171e75..afa64110 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -137,6 +137,7 @@ public: void end_undo_group(); bool undo(); bool redo(); + void reset_undo_data(); String string(const BufferIterator& begin, const BufferIterator& end) const;