From: Dekel Tsur Date: Fri, 9 Feb 2001 17:53:20 +0000 (+0000) Subject: Fix selection in insettext. X-Git-Tag: 1.6.10~21644 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=371c6ba3bac740cca54dd31bca0e8232468d9e40;p=features.git Fix selection in insettext. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1474 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 25c7d0e4d8..5388b4e6ab 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2001-02-09 Dekel Tsur + + * insettext.C (moveRightIntern): Update the selection cursor. + (moveLeftIntern): Ditto. + 2001-02-09 Jean-Marc Lasgouttes * Makefile.am: remove BoundingBox.h diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 342ac21083..ee26c8f475 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -843,7 +843,6 @@ InsetText::LocalDispatch(BufferView * bv, result = moveRight(bv); bv->text->FinishUndo(); TEXT(bv)->ClearSelection(); - TEXT(bv)->sel_cursor = TEXT(bv)->cursor; UpdateLocal(bv, CURSOR, false); break; case LFUN_LEFTSEL: @@ -856,7 +855,6 @@ InsetText::LocalDispatch(BufferView * bv, bv->text->FinishUndo(); result = moveLeft(bv); TEXT(bv)->ClearSelection(); - TEXT(bv)->sel_cursor = TEXT(bv)->cursor; UpdateLocal(bv, CURSOR, false); break; case LFUN_DOWNSEL: @@ -1260,24 +1258,28 @@ InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting) UpdatableInset::RESULT InsetText::moveRightIntern(BufferView * bv, bool behind, - bool activate_inset, bool /*selecting*/) + bool activate_inset, bool selecting) { if (!cpar(bv)->next && (cpos(bv) >= cpar(bv)->Last())) return FINISHED; if (activate_inset && checkAndActivateInset(bv, behind)) return DISPATCHED; TEXT(bv)->CursorRight(bv); + if (!selecting) + TEXT(bv)->sel_cursor = TEXT(bv)->cursor; return DISPATCHED_NOUPDATE; } UpdatableInset::RESULT InsetText::moveLeftIntern(BufferView * bv, bool behind, - bool activate_inset, bool /*selecting*/) + bool activate_inset, bool selecting) { if (!cpar(bv)->previous && (cpos(bv) <= 0)) return FINISHED; TEXT(bv)->CursorLeft(bv); + if (!selecting) + TEXT(bv)->sel_cursor = TEXT(bv)->cursor; if (activate_inset && checkAndActivateInset(bv, behind)) return DISPATCHED; return DISPATCHED_NOUPDATE;