int yo = bv().getPos(*this).y_;
Cursor old = *this;
// To next/previous row
+ // FIXME: the y position is often guessed wrongly across styles and
+ // insets, which leads to weird behaviour.
if (up)
tm.editXY(*this, xo, yo - textRow().ascent() - 1);
else
tm.editXY(*this, xo, yo + textRow().descent() + 1);
+ x_target_ = old.x_target_;
clearSelection();
// This happens when you move out of an inset.
if (edit && (inset->hasSettings() || !inset->contextMenuName().empty()))
return;
CoordCache::Insets const & insetCache = bv().coordCache().getInsets();
+ if (!insetCache.has(inset))
+ return;
int const wid = insetCache.dim(inset).wid;
Point p = insetCache.xy(inset);
if (x > p.x_ + (wid + 1) / 2)