aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-08-22 23:28:11 +0200
committerThomas White <taw@bitwiz.org.uk>2013-08-22 23:28:11 +0200
commit05662243972af0a5db0c62f19540b95e68eee8a5 (patch)
tree3b0b5fe1394bb033dd52f44921703a84a928f1c1 /src/mainwindow.c
parent378496d1f20de36489b9fdc3a76fbe9441dafd07 (diff)
Handle SC offsets for prologue (non-editable) boxes
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;