multiselect + printindex compatibility ref. #10

This commit is contained in:
bakkeby 2022-03-24 00:12:56 +01:00
parent b210a99e31
commit 67180f6288

View File

@ -11,20 +11,24 @@ static void
printsel(unsigned int state)
{
for (int i = 0;i < selidsize;i++)
if (selid[i] != -1 && (!sel || sel->id != selid[i]))
if (selid[i] != -1 && (!sel || sel->id != selid[i])) {
#if PRINTINDEX_PATCH
printf("%d\n", selid[i]);
#else
puts(items[selid[i]].text);
if (print_index)
printf("%d\n", selid[i]);
else
#endif // PRINTINDEX_PATCH
if (sel && !(state & ShiftMask))
puts(items[selid[i]].text);
}
if (sel && !(state & ShiftMask)) {
#if PRINTINDEX_PATCH
printf("%d\n", sel->index);
#else
puts(sel->text);
if (print_index)
printf("%d\n", sel->index);
else
#endif // PRINTINDEX_PATCH
else
puts(sel->text);
} else
puts(text);
}
static void