[LyX/master] Make sure that Cursor::setCurrentFont sets LaTeX language in ERT&friends

Jean-Marc Lasgouttes lasgouttes at lyx.org
Tue Nov 10 12:42:28 UTC 2020


commit 411333fa956c8980fee672364eabacf9f3b57d9d
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Nov 10 13:47:53 2020 +0100

    Make sure that Cursor::setCurrentFont sets LaTeX language in ERT&friends
    
    Fix issue when language is set to document language instead of
    latex_language in ERT and pass thru layouts.
    
    To trigger the issue
    1/ select all in a ERT inset
    2/ type "abc"
    3/ look at code in code preview pane
    
    ==> result: the "a" is in document language, the "bc" in LaTeX language
    (as should be)
---
 src/Cursor.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 97fbeb6..39083e5 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -2457,6 +2457,12 @@ void Cursor::setCurrentFont()
 		real_current_font.setLanguage(lang);
 		real_current_font.fontInfo().setNumber(FONT_OFF);
 	}
+
+	// No language in pass thru situations
+	if (cs.paragraph().isPassThru()) {
+		current_font.setLanguage(latex_language);
+		real_current_font.setLanguage(latex_language);
+	}
 }
 
 


More information about the lyx-cvs mailing list