]> git.lyx.org Git - features.git/commitdiff
Re-add removed workaround (fixes #9042).
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 19 Mar 2014 15:21:46 +0000 (16:21 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 19 Mar 2014 15:21:46 +0000 (16:21 +0100)
This code was commented out at [ad94e7bd/lyxgit], since we thought it was not necessary anymore and then removed at [5aede959/lyxgit]. Bug #9042 is the evidence that we were wrong.

src/insets/InsetText.cpp

index 94ea92c12695dfc254fa65cdde766fee7e663ccf..346e00797961cd9134dfc9e55c9a6b6d9544c7b6 100644 (file)
@@ -266,6 +266,18 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
 
+       // See bug #9042, for instance.
+       if (isPassThru() && lyxCode() != ARG_CODE) {
+               // Force any new text to latex_language FIXME: This
+               // should only be necessary in constructor, but new
+               // paragraphs that are created by pressing enter at
+               // the start of an existing paragraph get the buffer
+               // language and not latex_language, so we take this
+               // brute force approach.
+               cur.current_font.setLanguage(latex_language);
+               cur.real_current_font.setLanguage(latex_language);
+       }
+
        switch (cmd.action()) {
        case LFUN_PASTE:
        case LFUN_CLIPBOARD_PASTE: