mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
The focused main view's space binding delegates to the side panel beneath it, but the two handlers were asymmetric: the patch-toggle handler did its own re-render and re-established the selection itself, while the staging handler returned a focusViewName so the dispatcher (stageRange) could do the reveal-and-focus dance on its behalf. That split blocks collapsing the per-command handler channels into one, since the two have different return types. Make staging match the toggle: GetOnStageFocusedMainView returns plain error, and the FilesController handler does the post-staging reveal and pane focus itself. The reveal/select-mode logic the two handlers shared (collapse a range to a line, preserve the change-line ordinal across the re-render, re-expand a hunk) is extracted into revealSelectionAfterPrimaryAction, with mainContextForViewName resolving a main view name to its context. The dispatcher is now uniform: read the selected range, hand it to whichever handler the panel registered. Behavior-preserving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| traits | ||
| base_context.go | ||
| branches_context.go | ||
| commit_files_context.go | ||
| commit_message_context.go | ||
| confirmation_context.go | ||
| context.go | ||
| context_common.go | ||
| dynamic_title_builder.go | ||
| filtered_list.go | ||
| filtered_list_view_model.go | ||
| history_trait.go | ||
| list_context_trait.go | ||
| list_renderer.go | ||
| list_renderer_test.go | ||
| list_view_model.go | ||
| local_commits_context.go | ||
| local_commits_context_test.go | ||
| main_context.go | ||
| menu_context.go | ||
| merge_conflicts_context.go | ||
| parent_context_mgr.go | ||
| patch_explorer_context.go | ||
| prompt_context.go | ||
| reflog_commits_context.go | ||
| remote_branches_context.go | ||
| remotes_context.go | ||
| search_trait.go | ||
| setup.go | ||
| simple_context.go | ||
| stash_context.go | ||
| sub_commits_context.go | ||
| submodules_context.go | ||
| suggestions_context.go | ||
| tags_context.go | ||
| view_trait.go | ||
| working_tree_context.go | ||
| worktrees_context.go | ||