jesseduffield.lazygit/pkg
Stefan Haller fce4816a0d Fix branch selection jumping back on background fetch
When refreshing the branches list, we have code to keep the same branch selected
even when the refresh changes the sort order; this code remembers the selected
branch before the refresh, and then tries to select it again afterwards (looking
it up by name) if it is still there.

However, we stored the previously selected branch too early, before even
obtaining the branches list; if the user moved the selection between that point
and the end of the refresh, it would jump back. Fix this by remembering the
previous selection only at the last moment, right before assigning the new
branches slice.

We still have a race condition here between the UI code that manages the
selection as the user presses arrow keys, and the background thread doing the
refresh that reads and restores the selection; however, the race was there
before, and we make it neither better nor worse with this PR. It doesn't seem to
be a problem in practice.
2025-05-29 14:41:59 +02:00
..
app Make Commit.Hash a getter for an unexported hash field 2025-04-29 14:57:15 +02:00
cheatsheet Update to go 1.24 2025-03-08 14:53:54 -05:00
commands Kill background fetch when it requests a passphrase 2025-05-29 14:36:01 +02:00
common Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
config Add user config gui.addRootItemInFileTree 2025-05-24 18:17:25 +02:00
constants Make the links in the status panel point to the current version rather than master 2024-03-22 08:13:59 +01:00
env Support bare worktrees where worktree does not have its own .git file 2023-08-07 22:40:53 +10:00
fakes cleanup integration test code 2023-02-26 12:54:13 +11:00
gui Fix branch selection jumping back on background fetch 2025-05-29 14:41:59 +02:00
i18n Add an alternate keybinding (default <c-s>) for ConfirmInEditor 2025-05-11 13:59:22 +02:00
integration Add user config gui.addRootItemInFileTree 2025-05-24 18:17:25 +02:00
jsonschema Remove deprecated configs from auto generated config.md 2025-03-23 12:44:24 +01:00
logs Remove secureexec package 2023-07-30 19:59:51 +10:00
snake integrate snake game into lazygit 2022-12-30 12:18:59 +11:00
tasks Fix race condition when starting several command tasks in quick succession 2025-04-27 10:48:43 +02: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 Make RenameYamlKey return a bool 2025-05-21 08:51:24 +02:00