diff options
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index ddfe2df..48235c2 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -855,7 +855,17 @@ static void insert_text(char *t, SCEditor *e) if ( sbox->type == WRAP_BOX_NOTHING ) { printf("Upgrading nothing box to Pango box\n"); - return; + sbox->type = WRAP_BOX_PANGO; + sbox->col[0] = 0.0; + sbox->col[1] = 0.0; + sbox->col[2] = 0.0; + sbox->col[3] = 0.0; + sbox->n_segs = 1; + sbox->segs = malloc(sizeof(struct text_seg)); + sbox->len_chars = 0; + sbox->segs[0].glyphs = NULL; + sbox->segs[0].offs_char = sbox->offs_char; + sbox->segs[0].len_chars = 0; } sseg = which_segment(sbox, sps, &err); @@ -885,6 +895,8 @@ static void insert_text(char *t, SCEditor *e) struct wrap_box *nbox; + printf("Adding line break\n"); + /* Add a new box containing the text after the break */ insert_box(&e->cursor_frame->lines[sln], sbx); nbox = &e->cursor_frame->lines[sln].boxes[sbx]; |