diff --git a/src/ChangeLog b/src/ChangeLog index c816611866..42db2fcd4e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-11-18 Alfredo Braunstein + + * text2.C (setCursorIntern): move the x_target update here * + * text3.C: change some bv() to true/false in calls to + cursorUp/Down/Right/Left + * cursor.C: use helper function. + 2003-11-17 Alfredo Braunstein * BufferView_pimpl.C: send LFUN_MOUSE_MOTION to the cursor diff --git a/src/cursor.C b/src/cursor.C index 3f819f316e..88c47b2c6b 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -120,7 +120,7 @@ void LCursor::push(UpdatableInset * inset) { lyxerr << "LCursor::push() inset: " << inset << endl; data_.push_back(CursorItem(inset)); - cached_y_ = bv_->top_y() + innerInset()->y(); + updatePos(); } diff --git a/src/text2.C b/src/text2.C index 1a4bd22f2f..40aad755fa 100644 --- a/src/text2.C +++ b/src/text2.C @@ -257,7 +257,7 @@ void LyXText::toggleInset() && inset_owner->owner()->isOpen()) { finishUndo(); inset_owner->owner()->close(bv()); - bv()->getLyXText()->cursorRight(bv()); + bv()->getLyXText()->cursorRight(true); bv()->updateParagraphDialog(); } return; @@ -1175,7 +1175,7 @@ void LyXText::setSelectionRange(lyx::pos_type length) selection.cursor = cursor; while (length--) - cursorRight(bv()); + cursorRight(true); setSelection(); } @@ -1340,7 +1340,6 @@ void LyXText::setCursor(LyXCursor & cur, paroffset_type par, } // now get the cursors x position cur.x(int(getCursorX(pit, row, pos, boundary))); - bv()->x_target(cur.x()); } @@ -1405,6 +1404,7 @@ void LyXText::setCursorIntern(paroffset_type par, pos_type pos, bool setfont, bool boundary) { setCursor(cursor, par, pos, boundary); + bv()->x_target(cursor.x()); if (setfont) setCurrentFont(); } @@ -1620,7 +1620,7 @@ DispatchResult LyXText::moveRightIntern(bool front, bool activate_inset, bool se return DispatchResult(false, FINISHED_RIGHT); if (activate_inset && checkAndActivateInset(front)) return DispatchResult(true, true); - cursorRight(bv()); + cursorRight(true); if (!selecting) clearSelection(); return DispatchResult(true); @@ -1632,7 +1632,7 @@ DispatchResult LyXText::moveLeftIntern(bool front, { if (cursor.par() == 0 && cursor.pos() <= 0) return DispatchResult(false, FINISHED); - cursorLeft(bv()); + cursorLeft(true); if (!selecting) clearSelection(); if (activate_inset && checkAndActivateInset(front)) @@ -1645,7 +1645,7 @@ DispatchResult LyXText::moveUp() { if (cursorRow() == firstRow()) return DispatchResult(false, FINISHED_UP); - cursorUp(bv()); + cursorUp(false); clearSelection(); return DispatchResult(true); } @@ -1655,7 +1655,7 @@ DispatchResult LyXText::moveDown() { if (cursorRow() == lastRow()) return DispatchResult(false, FINISHED_DOWN); - cursorDown(bv()); + cursorDown(false); clearSelection(); return DispatchResult(true); } diff --git a/src/text3.C b/src/text3.C index e38fc13883..b44e491be0 100644 --- a/src/text3.C +++ b/src/text3.C @@ -1585,13 +1585,13 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd) case LFUN_FINISHED_LEFT: lyxerr << "swallow LFUN_FINISHED_LEFT" << endl; if (rtl()) - cursorRight(bv); + cursorRight(true); break; case LFUN_FINISHED_RIGHT: lyxerr << "swallow LFUN_FINISHED_RIGHT" << endl; if (!rtl()) - cursorRight(bv); + cursorRight(true); break; case LFUN_FINISHED_UP: @@ -1600,7 +1600,7 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd) case LFUN_FINISHED_DOWN: lyxerr << "swallow LFUN_FINISHED_DOWN" << endl; - cursorRight(bv); + cursorRight(true); break; default: