mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
`ctrl+o` in the focused main view copies the selection to the clipboard,
mirroring the staging view's copy. Unlike stage / discard, copying is the same
for every diff panel — it just reads the text shown — so it's a direct
MainViewController command rather than a FocusedMainViewActions method. That
keeps it free of per-panel duplication and lets it work over panels that have
no actions, notably the reflog.
The +/- prefix handling is metadata-aware where it matters: with no pager the
main view shows the raw diff, so a homogeneous selection has its +/-/space
column stripped (dropDiffPrefix) to ease pasting into code. With a pager
configured the rendered lines carry no such column, so stripping a leading
character would eat real content — copy verbatim instead. (Refining the raw
case to classify header lines via the diff-line metadata, fixing the
'--- a/file' edge case noted in
|
||
|---|---|---|
| .. | ||
| 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 | ||