]> git.lyx.org Git - features.git/commitdiff
Fix undo after breaking a nested paragraph
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 23 Nov 2018 15:53:53 +0000 (16:53 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 23 Nov 2018 15:53:53 +0000 (16:53 +0100)
We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.

src/frontends/qt4/GuiApplication.cpp

index c47610937bdb777bafc89d2644b8b215ccffd516..b9ba830c7b36827054bcdb9db43112694350cd1d 100644 (file)
@@ -1412,11 +1412,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_;
 }