mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 23:56:24 -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
|
||
|---|---|---|
| .. | ||
| Custom_Keybindings.md | ||
| Keybindings_en.md | ||
| Keybindings_ja.md | ||
| Keybindings_ko.md | ||
| Keybindings_nl.md | ||
| Keybindings_pl.md | ||
| Keybindings_pt.md | ||
| Keybindings_ru.md | ||
| Keybindings_zh-CN.md | ||
| Keybindings_zh-TW.md | ||