When the input text fully matches a single item, do not draw the item
and highlight the input text to show that it matches an item in
opposition to regular input text not matching anything.
{
unsigned int curpos;
struct item *item;
{
unsigned int curpos;
struct item *item;
+ int x = 0, y = 0, w, inputscheme;
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, 0, 0, mw, mh, 1, 1);
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, 0, 0, mw, mh, 1, 1);
if (prompt && *prompt) {
drw_setscheme(drw, scheme[SchemeSel]);
x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0);
if (prompt && *prompt) {
drw_setscheme(drw, scheme[SchemeSel]);
x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0);
}
/* draw input field */
w = (lines > 0 || !matches) ? mw - x : inputw;
}
/* draw input field */
w = (lines > 0 || !matches) ? mw - x : inputw;
- drw_setscheme(drw, scheme[SchemeNorm]);
+ if (matches && !strcmp(text, curr->text))
+ inputscheme = SchemeSel;
+ else
+ inputscheme = SchemeNorm;
+ drw_setscheme(drw, scheme[inputscheme]);
+
drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
if ((curpos += lrpad / 2 - 1) < w) {
drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
if ((curpos += lrpad / 2 - 1) < w) {
- drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_setscheme(drw, scheme[inputscheme]);
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) {
/* draw vertical list */
for (item = curr; item != next; item = item->right)
if (lines > 0) {
/* draw vertical list */
for (item = curr; item != next; item = item->right)
drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
}
}
drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0);
}
}
drw_map(drw, win, 0, 0, mw, mh);
}
drw_map(drw, win, 0, 0, mw, mh);
}