ui/ncurses/text-screen: trim long lines
authorJeremy Kerr <jk@ozlabs.org>
Wed, 14 Dec 2016 04:20:53 +0000 (12:20 +0800)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 20 Dec 2016 05:40:21 +0000 (16:40 +1100)
commitba14fc8ec91b54be57fdf2ca373e3d140ae2b6d6
treef32dbd642cd1d31cbe1ef08662c37fe6007ea447
parentf59937ad2d75b89d5e5129717f28338d26bae3c7
ui/ncurses/text-screen: trim long lines

When a text_screen is given a long line, it'll wrap to the next,
overstepping the left margin.

We already have folded text for flowed text screens, so just trim long
lines at the correct column.

This exposes an off-by-one with the automatic wrapping in
text_screen_set_text(), where we may overrun the last char, so fix that
too.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
ui/ncurses/nc-textscreen.c