jesseduffield.lazygit/pkg/gui/context
Stefan Haller 3eb5841b83 Fix searching commits or main view after switching repos
When switching to a different repo, and then back to the original one, searching
would no longer work. The reason is that our contexts set callbacks on their
views; when switching to a different repo we instantiate a new set of contexts,
so they will overwrite the views' callbacks with their new ones, but when
switching back to the original repo, we reuse the old contexts because they are
still in memory, but they won't set their callbacks again since they only do
this on construction.

To fix this, replace the view-local callbacks with a global one on the gui that
takes the view as an argument, so that the callback can look up the associated
context dynamically.
2026-03-27 14:26:20 +01:00
..
traits Fix collapsing the range selection after deleting branches 2025-07-04 17:18:10 +02:00
base_context.go Add GetOnClick to HasKeybindings 2026-03-25 17:08:02 +01:00
branches_context.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
commit_files_context.go Filter file views rather than search 2026-03-07 20:04:31 +01:00
commit_message_context.go Show "hooks disabled" in title bar of commit message editor 2025-04-10 08:57:32 +02:00
confirmation_context.go split context common from helper common 2023-04-30 13:19:53 +10:00
context.go Refactor: add a separate Prompt view 2025-09-05 10:42:03 +02:00
context_common.go split context common from helper common 2023-04-30 13:19:53 +10:00
dynamic_title_builder.go show namesake for child views 2022-03-26 18:00:46 +11:00
filtered_list.go Allow filtered lists to preprocess the filter string 2025-08-14 15:02:48 +02:00
filtered_list_view_model.go Allow filterable contexts to customize the filter label 2025-08-14 15:02:48 +02:00
history_trait.go Add search history 2023-09-20 08:35:41 +03:00
list_context_trait.go Update search position (match x of y) when changing the selection in a list view 2026-01-04 18:51:45 +01:00
list_renderer.go Make prepareConversionArrays a little more concurrency safe 2025-07-12 17:25:35 +02:00
list_renderer_test.go Enable intrange linter, and fix warnings 2025-06-30 18:30:11 +02:00
list_view_model.go Reduce the chance of race condition with list cursor 2024-01-28 09:20:52 +11:00
local_commits_context.go Fix searching commits or main view after switching repos 2026-03-27 14:26:20 +01:00
main_context.go Fix searching commits or main view after switching repos 2026-03-27 14:26:20 +01:00
menu_context.go Make menu keybindings take precedence over builtin ones, except for confirm/esc 2025-12-22 09:37:06 +01:00
merge_conflicts_context.go Instantiate other mutexes by value 2025-06-19 18:39:46 +02:00
parent_context_mgr.go Remove bool return value of GetParentContext() 2024-08-17 11:14:51 +02:00
patch_explorer_context.go Fix searching commits or main view after switching repos 2026-03-27 14:26:20 +01:00
prompt_context.go Refactor: add a separate Prompt view 2025-09-05 10:42:03 +02:00
reflog_commits_context.go Draw only visible part of the reflogs panel 2025-12-23 16:20:32 +01:00
remote_branches_context.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
remotes_context.go Adjust line number for working copy when editing a line 2025-01-07 17:46:51 +01:00
search_trait.go Bump gocui and adapt code accordingly 2026-01-04 18:48:47 +01:00
setup.go Refactor: add a separate Prompt view 2025-09-05 10:42:03 +02:00
simple_context.go Avoid scrolling the selection into view on refresh 2025-12-23 15:34:38 +01:00
stash_context.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
sub_commits_context.go Fix searching commits or main view after switching repos 2026-03-27 14:26:20 +01:00
submodules_context.go Get rid of the retain-sort-order-when-filtering logic again 2024-03-17 12:23:07 +01:00
suggestions_context.go Rename GetOnClick (et al) to GetOnDoubleClick 2026-03-25 14:58:53 +01:00
tags_context.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
view_trait.go Fix race condition in HandleRender 2025-12-23 16:20:32 +01:00
working_tree_context.go Filter file views rather than search 2026-03-07 20:04:31 +01:00
worktrees_context.go Get rid of the retain-sort-order-when-filtering logic again 2024-03-17 12:23:07 +01:00