menuinvertmode on curses

Change curses' use of menuitem_invert_test() to match the recently
changed tty behavior:  when menuinvertmode is 1 the test excludes
special menu items that are flagged 'skip-invert' while handling
select-all and select-page as well as invert-all and invert-page,
and when that option is 2 then it also operates on deselect-all and
deselect-page.
This commit is contained in:
PatR
2022-03-19 12:49:43 -07:00
parent 2d6581249e
commit 0cd98c402d

View File

@@ -1703,9 +1703,10 @@ menu_operation(
}
if (menu_item_ptr->identifier.a_void != NULL) {
if (operation != INVERT
|| menuitem_invert_test(0, menu_item_ptr->itemflags,
menu_item_ptr->selected))
if (menuitem_invert_test(((operation == INVERT) ? 0
: (operation == SELECT) ? 1 : 2),
menu_item_ptr->itemflags,
menu_item_ptr->selected))
menu_select_deselect(win, menu_item_ptr,
operation, current_page);
}