]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Amend 207eaeee9071cb
[lyx.git] / src / Buffer.cpp
index de7f4d217c98b947f09a0796de4f3607ca23f525..f4a02ca4e521f35048b2026bc8c8d6719091841a 100644 (file)
@@ -41,7 +41,6 @@
 #include "LaTeXFeatures.h"
 #include "LaTeX.h"
 #include "Layout.h"
-#include "Lexer.h"
 #include "LyXAction.h"
 #include "LyX.h"
 #include "LyXRC.h"
@@ -95,6 +94,7 @@
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/gzstream.h"
+#include "support/Lexer.h"
 #include "support/lstrings.h"
 #include "support/mutex.h"
 #include "support/os.h"
@@ -5562,6 +5562,9 @@ Buffer::ReadStatus Buffer::reload()
        Buffer const * oldparent = d->parent();
        d->setParent(nullptr);
        ReadStatus const status = loadLyXFile();
+       // The inset members in cursors held by buffer views are now wrong.
+       workAreaManager().sanitizeCursors();
+       setBusy(false);
        if (status == ReadSuccess) {
                updateBuffer();
                changed(true);
@@ -5578,7 +5581,6 @@ Buffer::ReadStatus Buffer::reload()
        } else {
                message(bformat(_("Could not reload document %1$s."), disp_fn));
        }
-       setBusy(false);
        removePreviews();
        updatePreviews();
        errors("Parse");