mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Clear undo/redo stack when reloading buffer. This fixes #7208.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37155 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
23609ed7fb
commit
a07d9f2192
@ -4250,6 +4250,7 @@ Buffer::ReadStatus Buffer::reload()
|
||||
updateTitles();
|
||||
markClean();
|
||||
message(bformat(_("Document %1$s reloaded."), disp_fn));
|
||||
d->undo_.clear();
|
||||
} else {
|
||||
message(bformat(_("Could not reload document %1$s."), disp_fn));
|
||||
}
|
||||
|
10
src/Undo.cpp
10
src/Undo.cpp
@ -241,6 +241,16 @@ Undo::~Undo()
|
||||
}
|
||||
|
||||
|
||||
void Undo::clear()
|
||||
{
|
||||
d->undostack_.clear();
|
||||
d->redostack_.clear();
|
||||
d->undo_finished_ = true;
|
||||
d->group_id = 0;
|
||||
d->group_level;
|
||||
}
|
||||
|
||||
|
||||
bool Undo::hasUndoStack() const
|
||||
{
|
||||
return !d->undostack_.empty();
|
||||
|
@ -53,6 +53,9 @@ public:
|
||||
|
||||
~Undo();
|
||||
|
||||
/// Clear out all undo/redo contents.
|
||||
void clear();
|
||||
|
||||
/// this will undo the last action - returns false if no undo possible
|
||||
bool textUndo(DocIterator &);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user