And also inline as promised: Index: src/Cursor.cpp =================================================================== --- src/Cursor.cpp (Revision 18579) +++ src/Cursor.cpp (Arbeitskopie) @@ -1168,7 +1168,7 @@ } -bool Cursor::upDownInText(bool up) +bool Cursor::upDownInText(bool up, bool & updateNeeded) { BOOST_ASSERT(text()); @@ -1248,12 +1248,11 @@ Cursor dummy = *this; if (dummy == old) ++dummy.pos(); - - bool const changed = bv().checkDepm(dummy, old); - - // Make sure that cur gets back whatever happened to dummy(Lgb) - if (changed) + if (bv().checkDepm(dummy, old)) { + updateNeeded = true; + // Make sure that cur gets back whatever happened to dummy(Lgb) operator=(dummy); + } } else {// if there is a selection, we stay out of any inset, and just jump to the right position:
Cursor old = *this; @@ -1274,7 +1273,7 @@ } } - bv().checkDepm(*this, old); + updateNeeded |= bv().checkDepm(*this, old); } updateTextTargetOffset(); Index: src/Cursor.h =================================================================== --- src/Cursor.h (Revision 18579) +++ src/Cursor.h (Arbeitskopie) @@ -256,12 +256,17 @@ /// return false for empty math insets bool backspace(); /// move the cursor up by sending an internal LFUN_UP + /// return true if fullscreen update is needed bool up(); - /// move the cursor up by sending an internal LFUN_DOWN + /// move the cursor up by sending an internal LFUN_DOWN, + /// return true if fullscreen update is needed bool down(); - /// move up/down in a text inset, called for LFUN_UP/DOWN - bool upDownInText(bool up); + /// move up/down in a text inset, called for LFUN_UP/DOWN, + /// return true if successful, updateNeeded set to true if fullscreen + /// update is needed, otherwise it's not touched + bool upDownInText(bool up, bool & updateNeeded); /// move up/down in math or any non text inset, call for LFUN_UP/DOWN + /// return true if successful bool upDownInMath(bool up); /// void plainErase(); Index: src/Text3.cpp =================================================================== --- src/Text3.cpp (Revision 18579) +++ src/Text3.cpp (Arbeitskopie) @@ -467,30 +467,28 @@ break; case LFUN_UP: - case LFUN_UP_SELECT: + case LFUN_UP_SELECT: { //lyxerr << "handle LFUN_UP[SEL]:\n" << cur << endl; needsUpdate |= cur.selHandle(cmd.action == LFUN_UP_SELECT); - needsUpdate |= cur.upDownInText(true); - - if (!needsUpdate && oldTopSlice == cur.top() - && cur.boundary() == oldBoundary) + bool const successful = cur.upDownInText(true, needsUpdate); + if (!successful) cur.undispatched(); if (cur.selection()) saveSelection(cur); break; + } case LFUN_DOWN: - case LFUN_DOWN_SELECT: + case LFUN_DOWN_SELECT: { //lyxerr << "handle LFUN_DOWN[SEL]:\n" << cur << endl; needsUpdate |= cur.selHandle(cmd.action == LFUN_DOWN_SELECT); - needsUpdate |= cur.upDownInText(false); - - if (!needsUpdate && oldTopSlice == cur.top() && - cur.boundary() == oldBoundary) + bool const successful = cur.upDownInText(false, needsUpdate); + if (!successful) cur.undispatched(); if (cur.selection()) saveSelection(cur); break; + } case LFUN_PARAGRAPH_UP: case LFUN_PARAGRAPH_UP_SELECT:
PGP.sig
Description: Signierter Teil der Nachricht