Buffer: add reset_undo_data method

This commit is contained in:
Maxime Coste 2012-08-10 14:21:32 +02:00
parent e5c46d7c45
commit c7fc2a9317
2 changed files with 8 additions and 0 deletions

View File

@ -196,6 +196,13 @@ bool Buffer::redo()
return true; 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 void Buffer::check_invariant() const
{ {
BufferSize start = 0; BufferSize start = 0;

View File

@ -137,6 +137,7 @@ public:
void end_undo_group(); void end_undo_group();
bool undo(); bool undo();
bool redo(); bool redo();
void reset_undo_data();
String string(const BufferIterator& begin, String string(const BufferIterator& begin,
const BufferIterator& end) const; const BufferIterator& end) const;