2020-04-04 09:58:35 +02:00
|
|
|
static void
|
|
|
|
drawhighlights(struct item *item, int x, int y, int maxw)
|
|
|
|
{
|
|
|
|
int i, indent;
|
|
|
|
char *highlight;
|
|
|
|
char c;
|
|
|
|
|
|
|
|
if (!(strlen(item->text) && strlen(text)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
drw_setscheme(drw, scheme[item == sel
|
|
|
|
? SchemeSelHighlight
|
|
|
|
: SchemeNormHighlight]);
|
|
|
|
for (i = 0, highlight = item->text; *highlight && text[i];) {
|
2020-04-09 08:54:00 +02:00
|
|
|
#if FUZZYMATCH_PATCH
|
|
|
|
if (!fstrncmp(&(*highlight), &text[i], 1))
|
|
|
|
#else
|
|
|
|
if (*highlight == text[i])
|
|
|
|
#endif // FUZZYMATCH_PATCH
|
|
|
|
{
|
2020-04-04 09:58:35 +02:00
|
|
|
/* get indentation */
|
|
|
|
c = *highlight;
|
|
|
|
*highlight = '\0';
|
|
|
|
indent = TEXTW(item->text);
|
|
|
|
*highlight = c;
|
|
|
|
|
|
|
|
/* highlight character */
|
|
|
|
c = highlight[1];
|
|
|
|
highlight[1] = '\0';
|
|
|
|
drw_text(
|
|
|
|
drw,
|
2020-04-05 18:01:50 +02:00
|
|
|
x + indent - (lrpad / 2),
|
2020-04-04 09:58:35 +02:00
|
|
|
y,
|
|
|
|
MIN(maxw - indent, TEXTW(highlight) - lrpad),
|
|
|
|
bh, 0, highlight, 0
|
2020-06-13 15:32:41 +02:00
|
|
|
#if PANGO_PATCH
|
|
|
|
, True
|
|
|
|
#endif // PANGO_PATCH
|
2020-04-04 09:58:35 +02:00
|
|
|
);
|
|
|
|
highlight[1] = c;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
highlight++;
|
|
|
|
}
|
2020-04-05 18:01:50 +02:00
|
|
|
}
|