*/
int offset = call_render_line_to_point(focus,
pm, m);
- if (offset >= 0) {
- measure_line(p, focus, m, offset);
- if (hp->cy >= rl->skip_height + rl->margin)
- /* Cursor is visible on this line
- * and after margin from top.
- */
- on_screen = True;
- else if (start_of_file && rl->skip_height == 0)
- /* Cannot make more margin space */
- on_screen = True;
- }
+ measure_line(p, focus, m, offset);
+ if (hp->cy >= rl->skip_height + rl->margin)
+ /* Cursor is visible on this line
+ * and after margin from top.
+ */
+ on_screen = True;
+ else if (start_of_file && rl->skip_height == 0)
+ /* Cannot make more margin space */
+ on_screen = True;
} else if (pm && m2 && y >= p->h && m->seq < pm->seq &&
mark_ordered_not_same(pm, m2)) {
/* point might be in this line, but off end
*/
int offset = call_render_line_to_point(focus,
pm, m);
- if (offset > 0) {
- int lh;
- measure_line(p, focus, m, offset);
- lh = attr_find_int(hp->attrs,
- "line-height");
- if (lh <= 0)
- lh = 1;
- if (y - hp->h + hp->cy <= p->h - lh - rl->margin) {
- /* Cursor is on screen */
- on_screen = True;
- }
+ int lh;
+ measure_line(p, focus, m, offset);
+ lh = attr_find_int(hp->attrs,
+ "line-height");
+ if (lh <= 0)
+ lh = 1;
+ if (hp->cy >= 0 &&
+ y - hp->h + hp->cy <= p->h - lh - rl->margin) {
+ /* Cursor is on screen */
+ on_screen = True;
}
} else if (pm && mark_ordered_or_same(m, pm) && m2 &&
(mark_ordered_not_same(pm, m2) ||
else {
int offset = call_render_line_to_point(
focus, pm, m);
- if (offset > 0) {
- int lh;
- int cy;
- measure_line(p, focus, m, offset);
- lh = attr_find_int(hp->attrs,
- "line-height");
- cy = y - hp->h + hp->cy;
- if (cy >= rl->margin &&
- cy <= p->h - rl->margin - lh)
- /* Cursor at least margin from edge */
- on_screen = True;
- }
+ int lh;
+ int cy;
+ measure_line(p, focus, m, offset);
+ lh = attr_find_int(hp->attrs,
+ "line-height");
+ cy = y - hp->h + hp->cy;
+ if (cy >= rl->margin &&
+ cy <= p->h - rl->margin - lh)
+ /* Cursor at least margin from edge */
+ on_screen = True;
}
}
}
if (!v || !v->mdata || !mark_ordered_or_same(v, m))
return Efallthrough;
offset = call_render_line_to_point(focus, m, v);
- if (offset < 0)
- return Efallthrough;
measure_line(p, focus, v, offset, &attr);
if (!attr)
return Efallthrough;