jesseduffield.lazygit/pkg/gui
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
..
context Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
controllers Support range selection for reverting commits 2025-04-20 16:03:06 +02:00
filetree Fix discarding submodule changes in nested folders 2025-04-07 09:42:19 +02:00
keybindings Move labelByKey to config package 2025-02-21 13:20:33 +01:00
mergeconflicts Remove redundant variable dedeclarations 2024-05-19 16:38:21 +10:00
modes Reference original commits in CherryPicking mode instead of synthesizing new ones 2025-04-20 15:59:48 +02:00
patch_exploring Fix crash when dragging from below the end of the diff upwards and then staging the range 2025-04-11 10:14:46 +02:00
popup Remove return value of Alert/Confirm/Prompt 2024-09-06 08:45:48 +02:00
presentation Show original todo action instead of "conflict", and show <-- CONFLICT instead 2025-04-20 15:55:44 +02:00
services/custom_commands Add runCommand function to Go template syntax 2025-04-09 10:44:36 +02:00
status Clean up error handling of WithWaitingStatus and WithWaitingStatusSync 2024-04-18 10:10:30 +02:00
style Add function to render a hyperlink 2024-08-24 10:36:01 +02:00
types Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
background.go Fix flicker when showing the status of a background fetch 2025-01-30 08:49:58 +01:00
command_log_panel.go Support home and end as alternatives to '<' and '>' 2025-03-17 19:58:01 +01:00
context.go Cleanup: get rid of the variadic parameter of ContextMgr.Push 2025-04-08 16:08:25 +02:00
context_config.go move some methods 2023-04-30 13:19:53 +10:00
controllers.go fix: Make tag operation use GPG helper to run signing in sub-process 2025-03-24 08:41:58 +01:00
dummies.go Optimize number of early calls to GetRepoPaths 2024-07-06 12:09:48 -07:00
editors.go Show "hooks disabled" in title bar of commit message editor 2025-04-10 08:57:32 +02:00
extras_panel.go Add pageUp/pageDown/top/bottom keybindings to focused command log panel 2025-04-08 16:11:15 +02:00
global_handlers.go Add pageUp/pageDown/top/bottom keybindings to confirmation panel 2025-04-08 16:11:15 +02:00
gui.go Cleanup: get rid of the variadic parameter of ContextMgr.Push 2025-04-08 16:08:25 +02:00
gui_common.go Get rid of error return value of PostRefreshUpdate and a few related ones 2024-10-13 16:55:54 +02:00
gui_driver.go Fix clicking multiple times in an integration test 2024-10-18 10:06:52 +02:00
information_panel.go Bump gocui and adapt lazygit code 2024-12-01 10:40:08 +01:00
keybindings.go Add pageUp/pageDown/top/bottom keybindings to focused command log panel 2025-04-08 16:11:15 +02:00
layout.go Set tab titles after reloading user config 2025-03-06 08:24:03 +01:00
main_panels.go Fix race with PTYs in integration tests 2025-03-28 11:16:04 +01:00
menu_panel.go Cleanup: get rid of the variadic parameter of ContextMgr.Push 2025-04-08 16:08:25 +02:00
options_map.go Make WorkingTreeState a struct, and add cherry-picking and reverting states 2025-04-20 15:53:17 +02:00
pty.go Fix race with PTYs in integration tests 2025-03-28 11:16:04 +01:00
pty_windows.go Format code to pass lint 2021-09-16 21:38:43 +08:00
recent_repos_panel.go Remove unused field gui.IsNewRepo 2024-12-01 10:44:26 +01:00
tasks_adapter.go Change NewRenderStringWith{out}ScrollTask to reuse the task key of the existing task 2024-10-18 22:46:47 +02:00
test_mode.go Don't wait in integration tests when running in headless mode 2024-06-05 14:44:02 +02:00
view_helpers.go Fix view selection running out of sync with list selection when view isn't focused 2025-04-20 16:06:15 +02:00
views.go Enable AutoRenderHyperLinks for the tooltip view 2025-04-08 16:05:34 +02:00