int x = cur.x_target();
setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
- cur.dispatch(FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
+ text_->dispatch(cur, FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
if (cpar == cur.pit() && cpos == cur.pos())
// we have a row which is taller than the workarea. The
// FIXME: This does not work within mathed!
CurStatus status(BufferView const * bv, DocIterator const & dit)
{
+ // FIXME: it's be better to have something like TextMetrics::status().
TextMetrics const & tm = bv->textMetrics(dit.bottom().text());
- if (tm.has(dit.bottom().pit()))
- return CUR_INSIDE;
- else if (dit.bottom().pit() < bv->anchor_ref())
+ pit_type const pit = dit.bottom().pit();
+ if (!tm.has(pit)) {
+ if (dit.bottom().pit() < bv->anchor_ref())
+ return CUR_ABOVE;
+ else
+ return CUR_BELOW;
+ }
+
+ ParagraphMetrics const & pm = tm.parMetrics(pit);
+ if (pm.position() < 0)
return CUR_ABOVE;
- else
+ else if (pm.position() > bv->workHeight())
return CUR_BELOW;
+
+ return CUR_INSIDE;
}
namespace {