diff --git a/TODO b/TODO index cc49802..98bc29b 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ # TODO for spmenu - Mouse bind array (mouse.h) -- Remove SGR sequences from width when item text is drawn, currently the width of the item before SGR sequences are used, resulting in some ugly behavior for the selected item (drawitem function libs/draw.c) - Add configuration file using (probably) libconfig diff --git a/libs/draw.c b/libs/draw.c index 4e907fe..5aeb081 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -66,7 +66,7 @@ drawitem(struct item *item, int x, int y, int w) buffer[wr] = '\0'; /* clear out character */ apply_fribidi(buffer); - rw = TEXTW(buffer) - lrpad; + rw = MIN(w, TEXTW(buffer) - lrpad); drw_text(drw, x, y, rw + lp, bh, lp, isrtl ? fribidi_text : buffer, 0, pango_item ? True : False); x += rw + lp;