-void TextMetrics::cursorPrevious(Cursor & cur)
-{
- pos_type cpos = cur.pos();
- pit_type cpar = cur.pit();
-
- int x = cur.x_target();
- setCursorFromCoordinates(cur, x, 0);
- cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
-
- if (cpar == cur.pit() && cpos == cur.pos())
- // we have a row which is taller than the workarea. The
- // simplest solution is to move to the previous row instead.
- cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP));
-
- cur.finishUndo();
- cur.updateFlags(Update::Force | Update::FitCursor);
-}
-
-
-void TextMetrics::cursorNext(Cursor & cur)
-{
- pos_type cpos = cur.pos();
- pit_type cpar = cur.pit();
-
- int x = cur.x_target();
- setCursorFromCoordinates(cur, x, cur.bv().workHeight() - 1);
- cur.dispatch(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
- // simplest solution is to move to the next row instead.
- cur.dispatch(
- FuncRequest(cur.selection()? LFUN_DOWN_SELECT: LFUN_DOWN));
-
- cur.finishUndo();
- cur.updateFlags(Update::Force | Update::FitCursor);
-}
-
-