mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 23:56:24 -04:00
Wire the focused main view's `d` binding to a DiscardSelection action on the side panel beneath, the discard counterpart of the primary action. As with stage/toggle, what discard means is the panel's business: - the files panel discards from the working tree, mirroring the staging view's `d` — reverse-apply not cached on the unstaged side (destructive, so confirmed), reverse-apply cached on the staged side (i.e. unstage); - the commit panels (commit files, and the whole-commit diff of the local commits / sub-commits / stash panels) remove the selected lines from the commit via a rebase, mirroring the patch builder's "discard lines from commit" — building a one-off patch from the selection and deleting it. The commit-discard backend and its guard are shared free functions in patch_building_from_main_view.go, paralleling the patch toggle. Discarding from a commit is only possible on a local branch, so DiscardSelection grows a disabled-reason companion on the FocusedMainViewActions interface: the `d` binding is greyed with a reason on stash and other-branch sub-commits (never rebaseable) and while a rebase is in progress, exactly as the patch builder greys it. The files panel is always available (a zero-context diff is the one error it reports inline, matching the staging view). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| dev | ||
| keybindings | ||
| Config.md | ||
| Custom_Command_Keybindings.md | ||
| Custom_DiffRenderers.md | ||
| Fixup_Commits.md | ||
| Range_Select.md | ||
| README.md | ||
| Searching.md | ||
| Stacked_Branches.md | ||
| Undoing.md | ||