]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
How about if we write a script to do some of this and stop doing it
[lyx.git] / src / Cursor.cpp
index a2fb6b9420b80f636837b6474299b87d0cc80229..0017e1ae149576b29cdc42ccf9475156691dc127 100644 (file)
@@ -483,8 +483,14 @@ void Cursor::resetAnchor()
 
 void Cursor::setCursorToAnchor()
 {
-       if (selection())
-               setCursor(anchor_);
+       if (selection()) {
+               DocIterator normal = anchor_;
+               while (depth() < normal.depth())
+                       normal.pop_back();
+               if (depth() < anchor_.depth() && top() <= anchor_[depth() - 1])
+                       ++normal.pos();
+               setCursor(normal);
+       }
 }