views.status: Improve selection handling across updates
We now manage the selection across updates much more carefully.
When items are staged they are selected and their
diff is automatically shown. Vice-versa for unstaged.
A group of selected items retains their selection across
category moves. If an item moves into a new category,
we scroll the viewport to the item in that category.
Priority is given to the current, partially-staged diff
when interactively staging hunks. Otherwise, we would
be breaking context by showing the unstaged diff and then
switching to the staged fragment.
Signed-off-by: David Aguilar <davvid@gmail.com>