[LyX/master] Handle InsetLayout environments for language tracking

Juergen Spitzmueller <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 3d43ffb5f1e6d37156baa10a4e0854de0800c3e8
Author: Juergen Spitzmueller <[email protected]>
Date:   Thu Mar 19 14:05:30 2026 +0100

    Handle InsetLayout environments for language tracking
---
 src/output_latex.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 4e49ccecad..bd6be2c557 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -1720,7 +1720,8 @@ void latexParagraphs(Buffer const & buf,
 	DocumentClass const & tclass = bparams.documentClass();
 
 	// Floats nest languages like (other) environments
-	if (runparams.inFloat != OutputParams::NONFLOAT)
+	if (runparams.inFloat != OutputParams::NONFLOAT
+	    || (!maintext && text.inset().isEnvironment()))
 		state->nest_level_ += 1;
 
 	// Did we already warn about inTitle layout mixing? (we only warn once)
@@ -1911,7 +1912,8 @@ void latexParagraphs(Buffer const & buf,
 	}
 
 	// Decrease nesting level at the end of floats
-	if (runparams.inFloat != OutputParams::NONFLOAT)
+	if (runparams.inFloat != OutputParams::NONFLOAT
+	    || (!maintext && text.inset().isEnvironment()))
 		state->nest_level_ -= 1;
 }
 
-- 
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.