detached a0541a8

refactor(daemon): drop unused copy targeting params

commit
a0541a8dd1b27ea4ad6dd009c686bdbfdd405a3e
author
brice · · 2026-07-10 07:51 UTC
parent
50dce66
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +8 -8
M internal/usecase/daemon/copymode_test.go +5 -5
@@ -642,7 +642,7 @@ func TestCursorTailHidesInCopyMode(t *testing.T) {
642642 require.Contains(t, string(data), "\x1b[?25l")
643643 }
644644
645-func installFloatingCopyFixture(t *testing.T, d *Daemon, sess *session, size domain.Size) *pane {
645+func installFloatingCopyFixture(t *testing.T, sess *session, size domain.Size) *pane {
646646 t.Helper()
647647 floatingPTY, releaseFloating := newBlockingPTY(t)
648648 t.Cleanup(releaseFloating)
@@ -675,7 +675,7 @@ func TestCopyModeCapturesSourceAndRetainsItAcrossFocusMove(t *testing.T) {
675675 main := tb.focusedPane()
676676 var want *pane
677677 if tc.useFloating {
678- want = installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})
678+ want = installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
679679 want.scrollback.Append(testRow("flt-old"))
680680 want.screen.Write([]byte("flt-live"))
681681 } else {
@@ -715,7 +715,7 @@ func TestFloatingCopyModeWheelUsesCapturedSnapshot(t *testing.T) {
715715 normal, releaseNormal := newBlockingPTY(t)
716716 defer releaseNormal()
717717 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
718- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})
718+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
719719 for i := range 30 {
720720 fp.scrollback.Append(testRow(fmt.Sprintf("old-%02d", i)))
721721 }
@@ -741,7 +741,7 @@ func TestFloatingCopyModeMouseSelectsFloatingRows(t *testing.T) {
741741 normal, releaseNormal := newBlockingPTY(t)
742742 defer releaseNormal()
743743 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
744- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})
744+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
745745 for i := range 5 {
746746 fp.scrollback.Append(testRow(fmt.Sprintf("old-%d", i)))
747747 }
@@ -773,7 +773,7 @@ func TestFloatingExitClearsCopyModeBeforeRepaint(t *testing.T) {
773773 defer releaseNormal()
774774 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
775775 tb := sess.activeTab()
776- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})
776+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
777777 fp.screen.Write([]byte("flt-live"))
778778
779779 d.enterCopyMode(sess, ac)
@@ -642,7 +642,7 @@ func TestCursorTailHidesInCopyMode(t *testing.T) {
642 require.Contains(t, string(data), "\x1b[?25l")642 require.Contains(t, string(data), "\x1b[?25l")
643 }643 }
644 644
645-func installFloatingCopyFixture(t *testing.T, d *Daemon, sess *session, size domain.Size) *pane {645+func installFloatingCopyFixture(t *testing.T, sess *session, size domain.Size) *pane {
646 t.Helper()646 t.Helper()
647 floatingPTY, releaseFloating := newBlockingPTY(t)647 floatingPTY, releaseFloating := newBlockingPTY(t)
648 t.Cleanup(releaseFloating)648 t.Cleanup(releaseFloating)
@@ -675,7 +675,7 @@ func TestCopyModeCapturesSourceAndRetainsItAcrossFocusMove(t *testing.T) {
675 main := tb.focusedPane()675 main := tb.focusedPane()
676 var want *pane676 var want *pane
677 if tc.useFloating {677 if tc.useFloating {
678- want = installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})678+ want = installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
679 want.scrollback.Append(testRow("flt-old"))679 want.scrollback.Append(testRow("flt-old"))
680 want.screen.Write([]byte("flt-live"))680 want.screen.Write([]byte("flt-live"))
681 } else {681 } else {
@@ -715,7 +715,7 @@ func TestFloatingCopyModeWheelUsesCapturedSnapshot(t *testing.T) {
715 normal, releaseNormal := newBlockingPTY(t)715 normal, releaseNormal := newBlockingPTY(t)
716 defer releaseNormal()716 defer releaseNormal()
717 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)717 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
718- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})718+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
719 for i := range 30 {719 for i := range 30 {
720 fp.scrollback.Append(testRow(fmt.Sprintf("old-%02d", i)))720 fp.scrollback.Append(testRow(fmt.Sprintf("old-%02d", i)))
721 }721 }
@@ -741,7 +741,7 @@ func TestFloatingCopyModeMouseSelectsFloatingRows(t *testing.T) {
741 normal, releaseNormal := newBlockingPTY(t)741 normal, releaseNormal := newBlockingPTY(t)
742 defer releaseNormal()742 defer releaseNormal()
743 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)743 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
744- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})744+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
745 for i := range 5 {745 for i := range 5 {
746 fp.scrollback.Append(testRow(fmt.Sprintf("old-%d", i)))746 fp.scrollback.Append(testRow(fmt.Sprintf("old-%d", i)))
747 }747 }
@@ -773,7 +773,7 @@ func TestFloatingExitClearsCopyModeBeforeRepaint(t *testing.T) {
773 defer releaseNormal()773 defer releaseNormal()
774 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)774 d, sess, ac, sends := newManualSessionWithPTYs(t, normal)
775 tb := sess.activeTab()775 tb := sess.activeTab()
776- fp := installFloatingCopyFixture(t, d, sess, domain.Size{Cols: 20, Rows: 3})776+ fp := installFloatingCopyFixture(t, sess, domain.Size{Cols: 20, Rows: 3})
777 fp.screen.Write([]byte("flt-live"))777 fp.screen.Write([]byte("flt-live"))
778 778
779 d.enterCopyMode(sess, ac)779 d.enterCopyMode(sess, ac)
M internal/usecase/daemon/render.go +2 -2
@@ -278,7 +278,7 @@ func (d *Daemon) render(sess *session, tb *tab, p *pane) {
278278 // copyTargetRectLocked maps a captured copy source into the already-composed
279279 // client frame. The caller holds tb.mu, preserving the layout/floating
280280 // snapshot while the rectangle is chosen.
281-func copyTargetRectLocked(tb *tab, layoutSnap tabLayoutSnapshot, contentArea domain.Rect, p, floating *pane, hasFloating bool, cfg domain.FloatingConfig) domain.Rect {
281+func copyTargetRectLocked(layoutSnap tabLayoutSnapshot, contentArea domain.Rect, p, floating *pane, hasFloating bool, cfg domain.FloatingConfig) domain.Rect {
282282 if p == nil {
283283 return domain.Rect{}
284284 }
@@ -400,7 +400,7 @@ func (d *Daemon) paint(sess *session, ac *attachedClient, reset bool) {
400400 if copyPane == nil {
401401 copyPane = p
402402 }
403- copyTarget := copyTargetRectLocked(tb, layoutSnap, contentArea, copyPane, floating, hasFloating, d.currentFloatingConfig())
403+ copyTarget := copyTargetRectLocked(layoutSnap, contentArea, copyPane, floating, hasFloating, d.currentFloatingConfig())
404404 frame, damage = composeCopyClientFrame(overlays.copyMode, copyPane, copyTarget, frame, bars)
405405 }
406406 // A palette above normal/copy content dims that composed content. When a
@@ -278,7 +278,7 @@ func (d *Daemon) render(sess *session, tb *tab, p *pane) {
278 // copyTargetRectLocked maps a captured copy source into the already-composed278 // copyTargetRectLocked maps a captured copy source into the already-composed
279 // client frame. The caller holds tb.mu, preserving the layout/floating279 // client frame. The caller holds tb.mu, preserving the layout/floating
280 // snapshot while the rectangle is chosen.280 // snapshot while the rectangle is chosen.
281-func copyTargetRectLocked(tb *tab, layoutSnap tabLayoutSnapshot, contentArea domain.Rect, p, floating *pane, hasFloating bool, cfg domain.FloatingConfig) domain.Rect {281+func copyTargetRectLocked(layoutSnap tabLayoutSnapshot, contentArea domain.Rect, p, floating *pane, hasFloating bool, cfg domain.FloatingConfig) domain.Rect {
282 if p == nil {282 if p == nil {
283 return domain.Rect{}283 return domain.Rect{}
284 }284 }
@@ -400,7 +400,7 @@ func (d *Daemon) paint(sess *session, ac *attachedClient, reset bool) {
400 if copyPane == nil {400 if copyPane == nil {
401 copyPane = p401 copyPane = p
402 }402 }
403- copyTarget := copyTargetRectLocked(tb, layoutSnap, contentArea, copyPane, floating, hasFloating, d.currentFloatingConfig())403+ copyTarget := copyTargetRectLocked(layoutSnap, contentArea, copyPane, floating, hasFloating, d.currentFloatingConfig())
404 frame, damage = composeCopyClientFrame(overlays.copyMode, copyPane, copyTarget, frame, bars)404 frame, damage = composeCopyClientFrame(overlays.copyMode, copyPane, copyTarget, frame, bars)
405 }405 }
406 // A palette above normal/copy content dims that composed content. When a406 // A palette above normal/copy content dims that composed content. When a
M internal/usecase/daemon/render_test.go +1 -1
@@ -1474,7 +1474,7 @@ func TestCopyTargetRectLocked(t *testing.T) {
14741474 }
14751475 for _, tc := range cases {
14761476 t.Run(tc.name, func(t *testing.T) {
1477- require.Equal(t, tc.want, copyTargetRectLocked(tb, layoutSnap, contentArea, tc.pane, tc.floating, tc.hasFloating, cfg))
1477+ require.Equal(t, tc.want, copyTargetRectLocked(layoutSnap, contentArea, tc.pane, tc.floating, tc.hasFloating, cfg))
14781478 })
14791479 }
14801480 }
@@ -1474,7 +1474,7 @@ func TestCopyTargetRectLocked(t *testing.T) {
1474 }1474 }
1475 for _, tc := range cases {1475 for _, tc := range cases {
1476 t.Run(tc.name, func(t *testing.T) {1476 t.Run(tc.name, func(t *testing.T) {
1477- require.Equal(t, tc.want, copyTargetRectLocked(tb, layoutSnap, contentArea, tc.pane, tc.floating, tc.hasFloating, cfg))1477+ require.Equal(t, tc.want, copyTargetRectLocked(layoutSnap, contentArea, tc.pane, tc.floating, tc.hasFloating, cfg))
1478 })1478 })
1479 }1479 }
1480 }1480 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close