1
0

Revert "Print highlighted input text only on single match"

This reverts commit a4053bc4e4.

My bad, was working on the wrong branch and accidently pushed it...
*facepalm*
This commit is contained in:
Hiltjo Posthuma 2016-07-26 23:02:34 +02:00
parent a4053bc4e4
commit aa92cd68bd

16
dmenu.c
View File

@ -130,7 +130,7 @@ drawmenu(void)
{ {
unsigned int curpos; unsigned int curpos;
struct item *item; struct item *item;
int x = 0, y = 0, w, inputscheme; int x = 0, y = 0, w;
drw_setscheme(drw, scheme[SchemeNorm]); drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, 0, 0, mw, mh, 1, 1); drw_rect(drw, 0, 0, mw, mh, 1, 1);
@ -138,27 +138,18 @@ drawmenu(void)
if (prompt && *prompt) { if (prompt && *prompt) {
drw_setscheme(drw, scheme[SchemeSel]); drw_setscheme(drw, scheme[SchemeSel]);
x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0); x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0);
x += 2;
} }
/* draw input field */ /* draw input field */
w = (lines > 0 || !matches) ? mw - x : inputw; w = (lines > 0 || !matches) ? mw - x : inputw;
if (matches && !strcmp(text, curr->text)) drw_setscheme(drw, scheme[SchemeNorm]);
inputscheme = SchemeSel;
else
inputscheme = SchemeNorm;
drw_setscheme(drw, scheme[inputscheme]);
drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0); drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL); drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
if ((curpos += lrpad / 2 - 1) < w) { if ((curpos += lrpad / 2 - 1) < w) {
drw_setscheme(drw, scheme[inputscheme]); drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0); drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
} }
if (inputscheme == SchemeSel)
goto drawmap;
if (lines > 0) { if (lines > 0) {
/* draw vertical list */ /* draw vertical list */
for (item = curr; item != next; item = item->right) for (item = curr; item != next; item = item->right)
@ -180,7 +171,6 @@ drawmenu(void)
drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0); drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
} }
} }
drawmap:
drw_map(drw, win, 0, 0, mw, mh); drw_map(drw, win, 0, 0, mw, mh);
} }