status: improve the selection behavior for header items
commitf0cc755729e7df5ec129f76956f715a0696ff041
authorDavid Aguilar <davvid@gmail.com>
Sun, 11 Jul 2021 21:19:50 +0000 (11 14:19 -0700)
committerDavid Aguilar <davvid@gmail.com>
Sun, 11 Jul 2021 22:25:09 +0000 (11 15:25 -0700)
tree9a65516a35220e43f26cde20c72a63ac9b8bc6e5
parentd8dca14cd40f27b81d33af0071a71eee51bd3e23
status: improve the selection behavior for header items

Extend the _restore_selection() logic to handle the cases where an item
header was previously selected and a new header item should be selected
instead.

Detect when the header selection would become empty and apply some
intuitive rules to select a corresponding sibling header instead.

Related-to: #1130 #1131
Signed-off-by: David Aguilar <davvid@gmail.com>
cola/widgets/status.py