dit[i].inset().edit(cursor_, true);
cursor_.setCursor(dit);
+ // remember new position.
+ cursor_.setTargetX();
cursor_.selection() = false;
}
cursor_ = cur;
cursor_.clearSelection();
+ // remember new position.
cursor_.setTargetX();
finishUndo();
return update;
<< endl;
setCursor(cur, pit, pos, true, bound);
+ // remember new position.
+ cur.setTargetX();
}
ParagraphMetrics const & pm = tm.parMetrics(cur.pit());
int row;
- int const x = cur.targetX();
-
if (cur.pos() && cur.boundary())
row = pm.pos2row(cur.pos()-1);
else
row = pm.pos2row(cur.pos());
+ // remember current position only if we are not at the end of a row.
+ if (cur.pos() != pm.rows()[row].endpos())
+ cur.setTargetX();
+ int const x = cur.targetX();
+
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_;
LCursor old = cur;
ParagraphMetrics const & pm = tm.parMetrics(cur.pit());
int row;
- int const x = cur.targetX();
-
if (cur.pos() && cur.boundary())
row = pm.pos2row(cur.pos()-1);
else
row = pm.pos2row(cur.pos());
+ // remember current position only if we are not at the end of a row.
+ if (cur.pos() != pm.rows()[row].endpos())
+ cur.setTargetX();
+ int const x = cur.targetX();
+
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_;
LCursor old = cur;