]> git.lyx.org Git - features.git/commitdiff
Fix selection in insettext.
authorDekel Tsur <dekelts@tau.ac.il>
Fri, 9 Feb 2001 17:53:20 +0000 (17:53 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Fri, 9 Feb 2001 17:53:20 +0000 (17:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1474 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettext.C

index 25c7d0e4d89a8371d904056d17209ca1702aac41..5388b4e6ab2a07943cf6d81c1915732bc4c2d085 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-09  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * insettext.C (moveRightIntern): Update the selection cursor.
+       (moveLeftIntern): Ditto.
+
 2001-02-09  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * Makefile.am: remove BoundingBox.h
index 342ac21083f04caa3f76c3329801fa3df0964394..ee26c8f475b0ee2973ad87297a621055fda3914f 100644 (file)
@@ -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;