]> git.lyx.org Git - features.git/commitdiff
Reset cursor font when entring an inset with char-forward/backward
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 17 Jul 2015 14:13:34 +0000 (16:13 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 21 Jul 2015 07:24:31 +0000 (09:24 +0200)
When entering an inset from the keyboard, setCurrentFont()
was not called and thus the cursor retained the font that was set
before. This could create strange behavior that could often go
unnoticed by the user.

It is easy to imagine many other situations similar to #9597 where
the user could trigger this bug.

Fixes bug #9597.

src/Text2.cpp

index fb6bd70f32fce5c92933b80cea63ff6c2419669b..9e6ec8ee1f038c0dbf7815f11c6c34c14b67757c 100644 (file)
@@ -614,6 +614,7 @@ bool Text::checkAndActivateInset(Cursor & cur, bool front)
        if (!front)
                --cur.pos();
        inset->edit(cur, front);
+       cur.setCurrentFont();
        return true;
 }
 
@@ -632,6 +633,7 @@ bool Text::checkAndActivateInsetVisual(Cursor & cur, bool movingForward, bool mo
                return false;
        inset->edit(cur, movingForward, 
                movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);
+       cur.setCurrentFont();
        return true;
 }