Fix undo after breaking a nested paragraph

We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.

(cherry picked from commit 57feb0fed0)
This commit is contained in:
Jean-Marc Lasgouttes 2018-11-23 16:53:53 +01:00
parent 09d742cc7f
commit 47adf27ac3
2 changed files with 8 additions and 3 deletions

View File

@ -1403,11 +1403,13 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
// This handles undo groups automagically
UndoGroupHelper ugh(buffer);
dispatch(cmd, dr);
// redraw the screen at the end (first of the two drawing steps).
// This is done unless explicitly requested otherwise.
// This code is kept inside the undo group because updateBuffer
// can create undo actions (see #11292)
updateCurrentView(cmd, dr);
}
// redraw the screen at the end (first of the two drawing steps).
// This is done unless explicitly requested otherwise
updateCurrentView(cmd, dr);
d->dispatch_result_ = dr;
return d->dispatch_result_;
}

View File

@ -65,6 +65,9 @@ What's new
- Fix broken space dialog in mathed (bug 7747).
- Fix undo in some cases involving nesting (bug 11292).
* INTERNALS