jesseduffield.lazygit/pkg/gui/types
Stefan Haller e90a3dc666 Fix view selection running out of sync with list selection when view isn't focused
When rerendering a view at the end of a refresh, we call HandleFocus only if the
view has the focus. This is so that we rerender the main view for the new
selection.

What was missing here is to update the view selection from the list selection if
the view doesn't have the focus, so that the selection is painted properly.
Normally this is not relevant because you don't see the selection if another
side panel has the focus; however, you do see it as an inactive selection when
e.g. a popup is shown, in which case it does matter.

This will become more important when we introduce section headers for commits,
because in that case the view selection needs to change when the working copy
state changes from normal to rebasing or vice versa, even if the list selection
stays the same.

The changed test submodule/reset.go shows how this was wrong before: when
entering the submodule again after resetting, there is a refresh which keeps the
same branch selected as before (master); however, since the branches panel is
not focused, the view didn't notice and kept thinking that the detached head is
selected (which it isn't, you can tell by running the test in sandbox mode and
focusing the branches panel at the end: you'll see that master is selected). So
the change in this commit fixes that.
2025-04-20 16:06:15 +02:00
..
common.go Move types/enums/enums.go to working_tree_state.go 2025-04-20 15:53:17 +02:00
common_commands.go start moving commit panel handlers into controller 2022-03-17 19:13:40 +11:00
context.go Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
keybindings.go Show mode-specific keybinding suggestions 2024-01-28 08:33:13 +11:00
modes.go Add a "Mark commit as base commit for rebase" command 2023-07-31 08:41:41 +02:00
ref.go Show diff for range selection in commits and sub-commits panel 2024-08-28 19:35:23 +02:00
refresh.go Return error from RefreshOptions.Then 2024-04-18 10:10:30 +02:00
rendering.go Visualize the "ignore whitespace" state in the subtitle of the diff view 2023-05-20 12:58:32 +10:00
search_state.go Add search history 2023-09-20 08:35:41 +03:00
suggestion.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
version_number.go Show popup message with breaking changes on startup 2024-03-12 13:27:14 +01:00
version_number_test.go Show popup message with breaking changes on startup 2024-03-12 13:27:14 +01:00
views.go Layout the bottom line view using spacer views 2023-12-09 11:18:28 +01:00