On 5/6/23 09:04, lorenzobertin...@gmail.com wrote:
Il giorno sab, 06/05/2023 alle 14.18 +0200, Jean-Marc Lasgouttes ha
scritto:
Le 06/05/2023 à 14:06, lorenzobertin...@gmail.com a écrit :

LyX: Long string not ended by `EndPreamble' [around line 4 of
file
current token: 'EndPreamble' context: '']
I never saw this issue. Can you send an example file where this
happens?

JMarc

Thanks for the info about the prefix. However, it happens with
different indentations, and even with none at all. I've attached a
barebone example; the message appears in the terminal, so remember to
launch LyX from there.

I see the warning when opening Document> Settings. Still happens with some content in between, too.

It seems to happen if there's nothing after the "EndPreamble". If I add just a comment, for example, it does away. Is the test !pimpl_->is failing because we're at the end of the stream?

Perhaps the attached?

Riki

From b68deb31cc7e77fafd83246a437946cd42fe272a Mon Sep 17 00:00:00 2001
From: Richard Kimberly Heck <rikih...@lyx.org>
Date: Sat, 6 May 2023 15:29:16 -0400
Subject: [PATCH] tmp

---
 src/Lexer.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Lexer.cpp b/src/Lexer.cpp
index c6402aec6f..ab052f5b77 100644
--- a/src/Lexer.cpp
+++ b/src/Lexer.cpp
@@ -690,6 +690,7 @@ docstring Lexer::getLongString(docstring const & endtoken)
 	docstring str;
 	docstring prefix;
 	bool firstline = true;
+	bool foundend = false;
 
 	while (pimpl_->is) { //< eatLine only reads from is, not from pushTok
 		if (!eatLine())
@@ -701,8 +702,10 @@ docstring Lexer::getLongString(docstring const & endtoken)
 		LYXERR(Debug::PARSER, "LongString: `" << tmpstr << '\'');
 
 		// We do a case independent comparison, like searchKeyword does.
-		if (compare_no_case(token, endtoken) == 0)
+		if (compare_no_case(token, endtoken) == 0) {
+			foundend = true;
 			break;
+		}
 
 		if (firstline) {
 			size_t i = tmpstr.find_first_not_of(from_ascii(" \t"));
@@ -720,7 +723,7 @@ docstring Lexer::getLongString(docstring const & endtoken)
 		str += tmpstr + '\n';
 	}
 
-	if (!pimpl_->is)
+	if (!foundend)
 		printError("Long string not ended by `" + to_utf8(endtoken) + '\'');
 
 	return str;
-- 
2.40.0

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to