mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
Pressing space in the commit-files focused main view now toggles the selected line(s)/hunk into or out of the custom patch, instead of being a no-op. It's the patch-building counterpart of working-tree staging from the main view: the selection is resolved to change-line identities the same way (ChangeLinesInViewRange), then mapped to the patch builder's per-file line indices and added or removed. The crux is that the commit's diff is unchanged by a toggle — only the inclusion set changes — so unlike staging there's no async re-render to ride. Membership is shown by an on-demand inclusion gutter: a reserved left column painted with a marker on every change line currently in the patch, recomputed synchronously after each toggle and on focusing the main view, over the existing pager output. This is what lets patch building work over a restructuring pager at all, where the old green first-char overlay (which rewrites the rendered bytes) can't. space routes to staging or patch building based on which handler the panel beneath registers, via a new onTogglePatchFocusedMainView channel (kept separate from staging because the post-action differs: sync gutter repaint vs async reveal). Scoped to the commit-files panel for now; commits/sub-commits/stash and the whole-commit multi-file diff follow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| context | ||
| controllers | ||
| filetree | ||
| mergeconflicts | ||
| modes | ||
| patch_exploring | ||
| popup | ||
| presentation | ||
| services/custom_commands | ||
| status | ||
| style | ||
| types | ||
| background.go | ||
| command_log_panel.go | ||
| context.go | ||
| context_config.go | ||
| controllers.go | ||
| dummies.go | ||
| editors.go | ||
| extras_panel.go | ||
| global_handlers.go | ||
| gui.go | ||
| gui_common.go | ||
| gui_driver.go | ||
| information_panel.go | ||
| keybindings.go | ||
| layout.go | ||
| main_panels.go | ||
| menu_panel.go | ||
| options_map.go | ||
| pty.go | ||
| pty_test.go | ||
| recent_repos_panel.go | ||
| side_panels.go | ||
| side_panels_test.go | ||
| tasks_adapter.go | ||
| tasks_adapter_test.go | ||
| test_mode.go | ||
| test_timeout_norace.go | ||
| test_timeout_race.go | ||
| view_helpers.go | ||
| views.go | ||