richterm

"terminal emulator" with support for text fonts and images for plan9
git clone git://nsmpr.xyz/richterm.git
Log | Files | Refs | README

commit b743529e7e7afa2e32da974fdc7d1f9fe54e0efa
parent 646f0cb8f1eac6f4c834560404727c1e5ab0d168
Author: Pavel Renev <an2qzavok@gmail.com>
Date:   Thu,  1 Jan 1970 01:41:54 +0000

better line wrapping

Diffstat:
Mrichterm.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/richterm.c b/richterm.c @@ -784,7 +784,14 @@ drawrune(DrawState *ds, Elem *e) bg = ((ds->n >= rich.selmin) && (ds->n < rich.selmax)) ? Iselbg : Inormbg; - if ((ds->pos.y >= rich.r.min.y - ds->font->height) && (ds->pos.y <= rich.r.max.y)) { + if (r.max.x > rich.r.max.x) { + if ((bg == Iselbg) && (rectXrect(r, rich.r) != 0)) + draw(screen, r, bg, nil, ZP); + ds->pos = ds->nlpos; + r = elemrect(ds, e); + } + + if (rectXrect(r, rich.r) != 0) { if (bg == Iselbg) draw(screen, r, bg, nil, ZP); runestringn(screen, ds->pos, fg, ZP, ds->font, R, 1); }