aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-03-21 00:23:48 +0100
committerThomas White <taw@bitwiz.org.uk>2013-03-21 00:23:48 +0100
commit0cfa6ad86163fc35292a0a844cd05dc9ef376e32 (patch)
tree8450f964a72078ac8d5c52b6af60de0ef2dd152f /src
parent4fdde18f9a8b266dc37217816b0b9b369f1e7eec (diff)
More cursor position
Diffstat (limited to 'src')
-rw-r--r--src/render.c1
-rw-r--r--src/wrap.c4
-rw-r--r--src/wrap.h1
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;
diff --git a/src/wrap.c b/src/wrap.c
index 6b8ce8d..9f09045 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -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;
}
diff --git a/src/wrap.h b/src/wrap.h
index 2bdc8dc..75af86b 100644
--- a/src/wrap.h
+++ b/src/wrap.h
@@ -35,6 +35,7 @@
enum wrap_box_type
{
WRAP_BOX_NOTHING,
+ WRAP_BOX_SENTINEL,
WRAP_BOX_PANGO,
WRAP_BOX_IMAGE
};