[LyX/master] Fix language setting after switching from PassThru paragraph (#13233)

Juergen Spitzmueller spitz at lyx.org
Tue Sep 8 07:32:52 UTC 2026


commit 65131c7b4d4b52902f44269c699ba670e2656357
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Sep 8 09:31:55 2026 +0200

    Fix language setting after switching from PassThru paragraph (#13233)
    
    Assisted-By: Claude Sonnet 5
---
 src/Text.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Text.cpp b/src/Text.cpp
index e6e650697e..34237a482c 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2574,6 +2574,7 @@ void Text::setLayout(pit_type start, pit_type end,
 
 	for (pit_type pit = start; pit != end; ++pit) {
 		Paragraph & par = pars_[pit];
+		bool const was_pass_thru = par.isPassThru();
 		// Is this a separating paragraph? If so,
 		// this needs to be standard layout
 		bool const is_separator = par.size() == 1
@@ -2581,6 +2582,10 @@ void Text::setLayout(pit_type start, pit_type end,
 		par.applyLayout(is_separator ? bp.documentClass().defaultLayout() : lyxlayout);
 		if (lyxlayout.margintype == MARGIN_MANUAL)
 			par.setLabelWidthString(par.expandLabel(lyxlayout, bp));
+		// If we switch from a pass-thru to a non-pass-thru paragraph,
+		// reset the language from latex to doc language (#13233)
+		if (was_pass_thru && !par.isPassThru())
+			par.changeLanguage(bp, latex_language, bp.language);
 	}
 
 	deleteEmptyParagraphMechanism(start, end - 1, bp.track_changes);


More information about the lyx-cvs mailing list