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();
namespace lyx {
+class BufferView;
+
namespace frontend {
/**
/// Update window titles of all users.
virtual void updateWindowTitle() = 0;
+
+ ///
+ virtual BufferView & bufferView() = 0;
+ ///
+ virtual BufferView const & bufferView() const = 0;
};
} // namespace frontend
#include "WorkAreaManager.h"
+#include "BufferView.h"
+#include "Cursor.h"
+
#include "Application.h"
#include "WorkArea.h"
}
+void WorkAreaManager::sanitizeCursors()
+{
+ for (WorkArea * wa : work_areas_) {
+ wa->bufferView().cursor().sanitize();
+ wa->bufferView().resetInlineCompletionPos();
+ }
+}
+
+
} // namespace frontend
} // namespace lyx
/// If there is no work area, create a new one in the current view using the
/// buffer buf. Returns false if not possible.
bool unhide(Buffer * buf) const;
+ /// Fix cursors in all buffer views held by work areas.
+ void sanitizeCursors();
private:
typedef std::list<WorkArea *>::iterator iterator;
/// is GuiView in fullscreen mode?
bool isFullScreen() const;
///
- BufferView & bufferView();
+ BufferView & bufferView() override;
///
- BufferView const & bufferView() const;
+ BufferView const & bufferView() const override;
///
void scheduleRedraw(bool update_metrics) override;