]> git.lyx.org Git - lyx.git/commitdiff
Upon exiting an inset, set the font back to what it was when entering.
authorDov Feldstern <dov@lyx.org>
Mon, 24 Sep 2007 22:20:03 +0000 (22:20 +0000)
committerDov Feldstern <dov@lyx.org>
Mon, 24 Sep 2007 22:20:03 +0000 (22:20 +0000)
This is related to the move of current_font from text to cursor (r19999).
Specifically, after r20261, this is necessary in order that the font not
remain in "latex_language" when exiting an ERT inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20477 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text2.cpp
src/Text3.cpp

index 4b04512a102e4c5b9c48c5f3beeb35cc1f6480b8..9fd32a7a9333cf224319d9f85d8cefff734be648 100644 (file)
@@ -636,7 +636,7 @@ bool Text::cursorLeft(Cursor & cur)
 
        // move to the previous paragraph or do nothing
        if (cur.pit() > 0)
-               return setCursor(cur, cur.pit() - 1, getPar(cur.pit() - 1).size());
+               return setCursor(cur, cur.pit() - 1, getPar(cur.pit() - 1).size(), true, false);
        return false;
 }
 
@@ -693,7 +693,7 @@ bool Text::cursorRight(Cursor & cur)
 
        // move to next paragraph
        if (cur.pit() != cur.lastpit())
-               return setCursor(cur, cur.pit() + 1, 0);
+               return setCursor(cur, cur.pit() + 1, 0, true, false);
        return false;
 }
 
index 3da55c9caabcc8b3074919f378b94512a6fb2cb1..408405d7605b364cdbeb22929b450c90aaa225dd 100644 (file)
@@ -1375,14 +1375,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_FINISHED_LEFT:
                LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_LEFT:\n" << cur << endl;
-               if (reverseDirectionNeeded(cur))
+               if (reverseDirectionNeeded(cur)) {
                        ++cur.pos();
+                       cur.setCurrentFont();
+               }
                break;
 
        case LFUN_FINISHED_RIGHT:
                LYXERR(Debug::DEBUG) << "handle LFUN_FINISHED_RIGHT:\n" << cur << endl;
-               if (!reverseDirectionNeeded(cur))
+               if (!reverseDirectionNeeded(cur)) {
                        ++cur.pos();
+                       cur.setCurrentFont();
+               }
                break;
 
        case LFUN_LAYOUT_PARAGRAPH: {