lazygit/pkg
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
..
app Remove unused cherry-picking code in daemon 2025-04-20 15:59:48 +02:00
cheatsheet Update to go 1.24 2025-03-08 14:53:54 -05:00
commands Support range selection for reverting commits 2025-04-20 16:03:06 +02:00
common Make common.UserConfig an atomic.Pointer for safe concurrent access 2024-08-18 10:24:52 +02:00
config Add a command to select all commits of the current branch 2025-04-10 09:02:09 +02:00
constants
env
fakes
gui Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
i18n Support range selection for reverting commits 2025-04-20 16:03:06 +02:00
integration Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
jsonschema Remove deprecated configs from auto generated config.md 2025-03-23 12:44:24 +01:00
logs
snake
tasks Suppress error logs when killing process on Windows 2025-02-15 14:51:35 +11:00
theme Highlight inactive selection in bold 2024-06-23 14:43:13 +02:00
updates Change direct access to Common.UserConfig to a getter 2024-08-18 10:24:52 +02:00
utils Migrate to only doing marshalling twice, and compare via deep copy 2025-02-27 17:05:31 -05:00