Upon exiting an inset, set the font back to what it was when entering.

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
This commit is contained in:
Dov Feldstern 2007-09-24 22:20:03 +00:00
parent 6294c20a24
commit 4c8544239e
2 changed files with 8 additions and 4 deletions

View 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;
}

View 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: {