aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r--src/mainwindow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 578640d..1171d77 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -829,6 +829,12 @@ static void draw_caret(cairo_t *cr, struct frame *fr, int pos)
double cx, clow, chigh;
const double t = 1.8;
+ /* Fix up cursor position if necessary */
+ if ( fr->pos < fr->lines[0].sc_offset ) {
+ fr->pos = fr->lines[0].sc_offset;
+ pos = fr->pos;
+ }
+
get_cursor_pos(fr, pos, &xposd, &yposd, &line_height);
cx = fr->x + xposd;