]> git.lyx.org Git - lyx.git/commitdiff
Update previews after pasting (#6211)
authorScott Kostyshak <skostysh@lyx.org>
Sun, 19 Apr 2015 17:46:04 +0000 (13:46 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Tue, 21 Apr 2015 06:51:54 +0000 (02:51 -0400)
The reason we want to do this is for if there is pasting across buffers.
For within buffer, the previews should already be updated. Calling the
buffer-wide updatePreviews() might seem like overkill, but actually it
should be quick because only the previews that need updating are updated
(and this check feels quick to me, although I did not profile).

If we were to loop through the pasted text and update each preview
individually, this might take more time. When updating previews
together, only one .tex file is compiled.

src/Text3.cpp

index 8398dd7b509250c2ab65edf94566a6da8e171ec1..4bd45c488a33c9da7166222a289e4960f2004d49 100644 (file)
@@ -1312,6 +1312,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                bv->buffer().errors("Paste");
                cur.clearSelection(); // bug 393
                cur.finishUndo();
+               bv->buffer().updatePreviews();
                break;
        }