diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-04-11 22:01:15 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-04-11 22:01:15 +0200 |
commit | 4cf06c3eede04e0c3c4f33f0be932e8b9fe5f01f (patch) | |
tree | 784e48aec8ad5b78fab04667af786ec65d1d5f7e /src | |
parent | 604887ea5163ee2fd3c838bb06d8a1783976b9e1 (diff) |
Handle newline at end of text
Diffstat (limited to 'src')
-rw-r--r-- | src/wrap.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -301,8 +301,22 @@ static int split_words(struct wrap_line *boxes, PangoContext *pc, char *sc, return 1; } - add_wrap_box(boxes, word, start, WRAP_SPACE_NONE, pc, - font, fontdesc, col); + if ( (word[i-start-1] == '\n') ) { + + /* There is a newline at the end of the SC */ + char *word2; + word2 = strndup(word, i-start-1); + add_wrap_box(boxes, word2, start, WRAP_SPACE_EOP, pc, + font, fontdesc, col); + add_wrap_box(boxes, strdup(""), i, WRAP_SPACE_NONE, pc, + font, fontdesc, col); + + } else { + + add_wrap_box(boxes, word, start, WRAP_SPACE_NONE, pc, + font, fontdesc, col); + + } } |