d->cursor_.fixIfBroken();
// FIXME: shift-mouse selection doesn't work well across insets.
- bool do_selection = select && &d->cursor_.anchor().inset() == &cur.inset();
+ bool do_selection = select && &d->cursor_.normalAnchor().inset() == &cur.inset();
// do the dEPM magic if needed
// FIXME: (1) move this to InsetText::notifyCursorLeaves?
}
-CursorSlice Cursor::anchor() const
+CursorSlice Cursor::normalAnchor() const
{
if (!selection())
return top();
{
if (!selection())
return top();
- return anchor() < top() ? anchor() : top();
+ return normalAnchor() < top() ? normalAnchor() : top();
}
{
if (!selection())
return top();
- return anchor() > top() ? anchor() : top();
+ return normalAnchor() > top() ? normalAnchor() : top();
}
DocIterator di;
// FIXME: This is a work-around for the problem that
// CursorSlice doesn't keep track of the boundary.
- if (anchor() == top())
+ if (normalAnchor() == top())
di = anchor_.boundary() > boundary() ? anchor_ : *this;
else
- di = anchor() < top() ? anchor_ : *this;
+ di = normalAnchor() < top() ? anchor_ : *this;
di.resize(depth());
return di;
}
DocIterator di;
// FIXME: This is a work-around for the problem that
// CursorSlice doesn't keep track of the boundary.
- if (anchor() == top())
+ if (normalAnchor() == top())
di = anchor_.boundary() < boundary() ? anchor_ : *this;
else
- di = anchor() > top() ? anchor_ : *this;
+ di = normalAnchor() > top() ? anchor_ : *this;
if (di.depth() > depth()) {
di.resize(depth());
setSelection(true);
// A selection with no contents is not a selection
// FIXME: doesnt look ok
- if (idx() == anchor().idx() &&
- pit() == anchor().pit() &&
- pos() == anchor().pos())
+ if (idx() == normalAnchor().idx() &&
+ pit() == normalAnchor().pit() &&
+ pos() == normalAnchor().pos())
setSelection(false);
}
int textTargetOffset() const;
/// access to normalized selection anchor
- CursorSlice anchor() const;
+ CursorSlice normalAnchor() const;
/// sets anchor to cursor position
void resetAnchor();
/// access to owning BufferView
// This is our text.
&& cur.text() == text_
// if the anchor is outside, this is not our selection
- && cur.anchor().text() == text_
+ && cur.normalAnchor().text() == text_
&& pit >= sel_beg.pit() && pit <= sel_end.pit();
// We store the begin and end pos of the selection relative to this par
if (bv->cursor().selection()) {
// set the cursor at the beginning or at the end of the selection
// before searching. Otherwise, the current change will be found.
- if (next != (bv->cursor().top() > bv->cursor().anchor()))
+ if (next != (bv->cursor().top() > bv->cursor().normalAnchor()))
bv->cursor().setCursorToAnchor();
}
bool const pi_selected = pi_.selected;
Cursor const & cur = pi_.base.bv->cursor();
if (cur.selection() && cur.text() == &text_
- && cur.anchor().text() == &text_)
+ && cur.normalAnchor().text() == &text_)
pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos;
paintInset(inset, pos);
pi_.selected = pi_selected;
bool const pi_selected = pi_.selected;
Cursor const & cur = pi_.base.bv->cursor();
if (cur.selection() && cur.text() == &text_
- && cur.anchor().text() == &text_)
+ && cur.normalAnchor().text() == &text_)
pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos;
paintInset(inset, pos);
pi_.selected = pi_selected;