[LyX/master] Load externally referred buffers and initialize their labels

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 5f7a66e3efe65363afd400e178961631510effbd
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Apr 11 12:07:46 2026 +0200

    Load externally referred buffers and initialize their labels
---
 src/Buffer.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index d9af5c4e46..5471f89cfa 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2560,8 +2560,16 @@ void Buffer::registerExternalRefs(FileName fn) const
 
 	vector<FileName>::const_iterator temp =
 		find(d->external_xrefed_files_.begin(), d->external_xrefed_files_.end(), fn);
-	if (temp == d->external_xrefed_files_.end())
+	if (temp == d->external_xrefed_files_.end()) {
 		d->external_xrefed_files_.push_back(fn);
+		// we also need to load these files in the background
+		// and update their buffer to get valid ref insets
+		if (!theBufferList().getBuffer(fn)) {
+			Buffer * xb = checkAndLoadLyXFile(fn, true);
+			if (xb)
+				xb->updateBuffer();
+		}
+	}
 }
 
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.