status: improve the selection behavior
Extend the _store_selection() logic to handle the cases where an item
was previously selected and moved to a new category.
Detect when the selection would become empty and apply some intuitive
rules to reselect items so that the user's selection is preserved in
more scenarios.
Attempt to select Unmerged, Modified and Untracked files when a Staged
file was previously selected and no longer exists in the Staged
category.
Attempt to select Staged, Modified and Untracked files when an Umerged
file was previously selected and no longer exists in the Unmerged
category.
Attempt to select Staged and Untracked files when a Modified file was
previously selected and no longer exists in the Modified category.
Attempt to select Staged, Unmerged and Modified files when an Untracked
file was previously selected and no longer exists in the Untracked
category.
Closes #1130 #1131
Suggested-by: @birgersp on github.com
Signed-off-by: David Aguilar <davvid@gmail.com>