aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sc_editor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index ab98165..7fbf15e 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -490,14 +490,17 @@ static void draw_caret(cairo_t *cr, struct frame *fr, int cursor_para,
return;
}
+ assert(fr != NULL);
+
para = fr->paras[cursor_para];
- offs = pos_trail_to_offset(para, cursor_pos, cursor_trail);
- if ( get_cursor_pos(fr, cursor_para, offs, &cx, &clow, &h) )
- {
+ if ( para_type(para) != PARA_TYPE_TEXT ) {
draw_para_highlight(cr, fr, cursor_para);
return;
}
+ offs = pos_trail_to_offset(para, cursor_pos, cursor_trail);
+ get_cursor_pos(fr, cursor_para, offs, &cx, &clow, &h);
+
cx += fr->x;
clow += fr->y;
chigh = clow + h;