X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fcursor.C;h=42a0c7cf1bfcc318e985ed8121705f6202d45f5e;hb=2734cc154853c61a7ea54bfeea3adc908f68bdc5;hp=69095b37ee3641bc0fc866f1d1f5f4c6185fd8e6;hpb=de6418f37765fe452f135f96dee6d49897bff215;p=lyx.git diff --git a/src/cursor.C b/src/cursor.C index 69095b37ee..42a0c7cf1b 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -285,7 +285,7 @@ void LCursor::dispatch(FuncRequest const & cmd0) // The common case is 'LFUN handled, need update', so make the // LFUN handler's life easier by assuming this as default value. // The handler can reset the update and val flags if necessary. - disp_.update(true); + disp_.update(Update::FitCursor | Update::Force); disp_.dispatched(true); inset().dispatch(*this, cmd); if (disp_.dispatched()) @@ -296,7 +296,7 @@ void LCursor::dispatch(FuncRequest const & cmd0) if (!disp_.dispatched()) { lyxerr[Debug::DEBUG] << "RESTORING OLD CURSOR!" << endl; operator=(safe); - disp_.update(false); + disp_.update(Update::None); disp_.dispatched(false); } } @@ -527,14 +527,15 @@ void LCursor::info(odocstream & os) const } -void LCursor::selHandle(bool sel) +bool LCursor::selHandle(bool sel) { //lyxerr << "LCursor::selHandle" << endl; if (sel == selection()) - return; + return false; resetAnchor(); selection() = sel; + return true; } @@ -899,9 +900,6 @@ int LCursor::targetX() const void LCursor::setTargetX() { - // For now this is good enough. A better solution would be to - // avoid this rebreak by setting cursorX only after drawing - bottom().text()->redoParagraph(bottom().pit()); int x; int y; getPos(x, y); @@ -1174,9 +1172,9 @@ string LCursor::currentState() } -string LCursor::getPossibleLabel() +docstring LCursor::getPossibleLabel() { - return inMathed() ? "eq:" : text()->getPossibleLabel(*this); + return inMathed() ? from_ascii("eq:") : text()->getPossibleLabel(*this); } @@ -1212,15 +1210,15 @@ void LCursor::dispatched() } -void LCursor::needsUpdate() +void LCursor::updateFlags(Update::flags f) { - disp_.update(true); + disp_.update(f); } void LCursor::noUpdate() { - disp_.update(false); + disp_.update(Update::None); }