]> git.lyx.org Git - features.git/commitdiff
Do not forget to set cursor current font when selecting
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Oct 2017 09:56:09 +0000 (11:56 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 11 Oct 2017 09:59:58 +0000 (11:59 +0200)
Fix several unreleated cases where the `selecting' code path did not
reset cursor font correctly. This leads to a caret that does not have
the correct size, and can cause caret droppings with the new display
scheme.

src/Cursor.cpp
src/Text3.cpp

index 0d686486859dbce21d5c43bdfd85a1103005944b..d21570a41fd77ab53e2c9c96c1823647787a9c2f 100644 (file)
@@ -1974,6 +1974,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                bool bound = false;
                top().pos() = tm.getPosNearX(real_next_row, xo, bound);
                boundary(bound);
+               // When selection==false, this is done by TextMetrics::editXY
+               setCurrentFont();
 
                updateNeeded |= bv().checkDepm(*this, old);
        }
index f6930aa591b3b21551ca36e139df407cdd4b60d0..930b5347c2d79fc48504a8513588ffe6419f9848 100644 (file)
@@ -835,6 +835,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                break;
                }
                cur.pos() = cur.lastpos();
+               cur.boundary(false);
+               cur.setCurrentFont();
 
                needsUpdate |= cur != old_cur;
                break;
@@ -1713,6 +1715,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                // reset the anchor.
                bvcur.setCursor(cur);
                bvcur.selection(true);
+               bvcur.setCurrentFont();
                if (cur.top() == old) {
                        // We didn't move one iota, so no need to update the screen.
                        cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);