neodotfiles/user/.config/suckless/dmenu/patch/numbers.c
Clay Gomera 75927f319c Updated
2022-07-01 02:06:16 -04:00

16 lines
361 B
C

static char numbers[NUMBERSBUFSIZE] = "";
static void
recalculatenumbers()
{
unsigned int numer = 0, denom = 0;
struct item *item;
if (matchend) {
numer++;
for (item = matchend; item && item->left; item = item->left)
numer++;
}
for (item = items; item && item->text; item++)
denom++;
snprintf(numbers, NUMBERSBUFSIZE, "%d/%d ", numer, denom);
}