jesseduffield.lazygit/docs-master
Stefan Haller e9c4425df6 Discard the selected diff line(s) from the focused main view
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>
2026-08-08 12:59:00 +02:00
..
dev Make copies of the docs and schema folders 2025-11-12 08:44:56 +01:00
keybindings Discard the selected diff line(s) from the focused main view 2026-08-08 12:59:00 +02:00
Config.md Replace gui.showSelectionInFocusedMainView config with on-demand selection 2026-08-08 12:58:59 +02:00
Custom_Command_Keybindings.md Convert keybinding fields to Keybinding 2026-05-25 15:32:47 +02:00
Custom_DiffRenderers.md Adapt documentation 2026-07-31 08:42:51 +02:00
Fixup_Commits.md Make copies of the docs and schema folders 2025-11-12 08:44:56 +01:00
Range_Select.md Make copies of the docs and schema folders 2025-11-12 08:44:56 +01:00
README.md Adapt documentation 2026-07-31 08:42:51 +02:00
Searching.md Make copies of the docs and schema folders 2025-11-12 08:44:56 +01:00
Stacked_Branches.md Make copies of the docs and schema folders 2025-11-12 08:44:56 +01:00
Undoing.md Fix undo shortcut in Undoing.md 2026-05-26 09:45:41 +02:00