commit 88d0390724c60410dd680a2528eab5c91b1252ce Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Wed Oct 11 11:56:09 2017 +0200
Do not forget to set cursor current font when selecting 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 | 2 ++ src/Text3.cpp | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 0d68648..d21570a 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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); } diff --git a/src/Text3.cpp b/src/Text3.cpp index f6930aa..930b534 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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);