From c7fc2a931716e3d63ad6af648a3c18a658ae3c40 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 10 Aug 2012 14:21:32 +0200 Subject: [PATCH] Buffer: add reset_undo_data method --- src/buffer.cc | 7 +++++++ src/buffer.hh | 1 + 2 files changed, 8 insertions(+) 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;