mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Make setCursorToAnchor set the cursor to the normalized selection anchor in stead of the real anchor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32790 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
fe75690c03
commit
742ee134a4
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
void leaveInset(Inset const & inset);
|
||||
/// sets cursor part
|
||||
void setCursor(DocIterator const & it);
|
||||
/// sets the cursor to the anchor
|
||||
/// sets the cursor to the normalized selection anchor
|
||||
void setCursorToAnchor();
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user