From: Connor Lane Smith Date: Fri, 30 Jul 2010 09:26:12 +0000 (+0100) Subject: underline match X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=7f36736d11418b0b11d02da8aa0cb663406706c2;p=dmenu.git underline match --- diff --git a/dmenu.c b/dmenu.c index 076cffe..9386e06 100644 --- a/dmenu.c +++ b/dmenu.c @@ -158,8 +158,13 @@ drawbar(void) { void drawitem(const char *s, unsigned long col[ColLast]) { + const char *p; + unsigned int w = textnw(&dc, text, strlen(text)); + drawbox(&dc, col); drawtext(&dc, s, col); + for(p = fstrstr(s, text); *text && (p = fstrstr(p, text)); p++) + drawline(&dc, textnw(&dc, s, p-s) + dc.h/2 - 1, dc.h-2, w, 1, col); } void