]> git.lyx.org Git - features.git/commitdiff
Fixup aeb51be9: set current font correctly when editing inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 Nov 2020 14:39:47 +0000 (15:39 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 10 Nov 2020 14:43:48 +0000 (15:43 +0100)
When using InsetText::edit(), invoke Cursor::setCurrentFont (note that
editXY does it already). It is a good idea in general, especially
after commit 411333fa95, which sets languagecorrectly in ERT.

This allows to comment out (again!) the trick added to fix ticket #9042.

src/insets/InsetText.cpp

index f72b9a639658ae0c1585ea441d46f76ee152cd62..ec223fa83a13c5350979be155ef4d1dc28ec5d29 100644 (file)
@@ -280,6 +280,7 @@ void InsetText::edit(Cursor & cur, bool front, EntryDirection entry_from)
        }
 
        cur.top().setPitPos(pit, pos);
+       cur.setCurrentFont();
        cur.finishUndo();
 }
 
@@ -294,6 +295,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
 
+#if 0
        // See bug #9042, for instance.
        if (isPassThru()) {
                // Force any new text to latex_language FIXME: This
@@ -305,6 +307,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.current_font.setLanguage(latex_language);
                cur.real_current_font.setLanguage(latex_language);
        }
+#endif
 
        switch (cmd.action()) {
        case LFUN_PASTE: