Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
underline match
[dmenu.git]
/
dmenu.c
diff --git
a/dmenu.c
b/dmenu.c
index
2c1867c
..
9386e06
100644
(file)
--- a/
dmenu.c
+++ b/
dmenu.c
@@
-24,7
+24,7
@@
static void calcoffsetsv(void);
static char *cistrstr(const char *s, const char *sub);
static void cleanup(void);
static void dinput(void);
static char *cistrstr(const char *s, const char *sub);
static void cleanup(void);
static void dinput(void);
-static void drawitem(char *s, unsigned long col[ColLast]);
+static void drawitem(c
onst c
har *s, unsigned long col[ColLast]);
static void drawmenuh(void);
static void drawmenuv(void);
static void match(void);
static void drawmenuh(void);
static void drawmenuv(void);
static void match(void);
@@
-140,6
+140,7
@@
drawbar(void) {
/* print prompt? */
if(prompt) {
dc.w = promptw;
/* print prompt? */
if(prompt) {
dc.w = promptw;
+ drawbox(&dc, selcol);
drawtext(&dc, prompt, selcol);
dc.x += dc.w;
}
drawtext(&dc, prompt, selcol);
dc.x += dc.w;
}
@@
-156,9
+157,14
@@
drawbar(void) {
}
void
}
void
-drawitem(char *s, unsigned long col[ColLast]) {
+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);
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
}
void