diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-03-21 00:23:48 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-03-21 00:23:48 +0100 |
commit | 0cfa6ad86163fc35292a0a844cd05dc9ef376e32 (patch) | |
tree | 8450f964a72078ac8d5c52b6af60de0ef2dd152f | |
parent | 4fdde18f9a8b266dc37217816b0b9b369f1e7eec (diff) |
More cursor position
-rw-r--r-- | src/render.c | 1 | ||||
-rw-r--r-- | src/wrap.c | 4 | ||||
-rw-r--r-- | src/wrap.h | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/render.c b/src/render.c index 7743eb2..1b6aaf5 100644 --- a/src/render.c +++ b/src/render.c @@ -86,6 +86,7 @@ static void render_boxes(struct wrap_line *line, cairo_t *cr) break; case WRAP_BOX_NOTHING : + case WRAP_BOX_SENTINEL : /* Do nothing */ break; @@ -109,6 +109,7 @@ void get_cursor_pos(struct frame *fr, size_t pos, for ( i=0; i<l->n_boxes-1; i++ ) { box = i; if ( l->boxes[i+1].sc_offset > pos ) break; + if ( l->boxes[i+1].type == WRAP_BOX_SENTINEL ) break; *xposd += l->boxes[i].width; if ( i < l->n_boxes-2 ) { *xposd += l->boxes[i].sp; @@ -596,7 +597,7 @@ static void knuth_suboptimal_fit(struct wrap_line *boxes, double line_length, if ( boxes->n_boxes == boxes->max_boxes ) return; } box = &boxes->boxes[boxes->n_boxes]; - box->type = WRAP_BOX_NOTHING; + box->type = WRAP_BOX_SENTINEL; box->text = NULL; box->space = WRAP_SPACE_NONE; box->font = NULL; @@ -769,6 +770,7 @@ void wrap_line_free(struct wrap_line *l) break; case WRAP_BOX_NOTHING : + case WRAP_BOX_SENTINEL : break; } @@ -35,6 +35,7 @@ enum wrap_box_type { WRAP_BOX_NOTHING, + WRAP_BOX_SENTINEL, WRAP_BOX_PANGO, WRAP_BOX_IMAGE }; |