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