detached 1b6fda7

perf(copy): reuse full history rows for selection bounds

commit
1b6fda79f0bbfff873328267dc6c9c8fdc77d334
author
brice · · 2026-10-05 08:11 UTC
parent
b6b7265
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +8 -8
M internal/usecase/copy/mode.go +8 -8
@@ -605,19 +605,19 @@ func (m *Mode) RenderRowsRange(start, end int, paint func(int, []renderer.Cell),
605605 cursorCovered := false
606606 if hasSelectionBounds {
607607 bound := d.snapshot.Bound(src)
608- limit := contentEndOf(row[:n], bound)
609- if n < d.RowWidth(src) {
610- limit = d.contentEnd(src)
611- }
612- r, ok := selectionBounds.rangeForCells(src, row, limit)
613- if n < d.RowWidth(src) {
614- r, ok = selectionBounds.rangeForRow(d, src)
608+ width := d.RowWidth(src)
609+ cells, rangeCells := row[:n], row
610+ if n < width {
611+ cells = d.Row(src)
612+ rangeCells = cells
615613 }
614+ limit := contentEndOf(cells, bound)
615+ r, ok := selectionBounds.rangeForCells(src, rangeCells, limit)
616616 if ok {
617617 for x := max(r.Start, 0); x <= min(r.End, len(row)-1); x++ {
618618 toggleInverse(&row[x].Style)
619619 }
620- if col, ok := selectionBounds.newlineMarkerAt(src, limit, d.RowWidth(src), bound.Soft); ok && col < len(row) {
620+ if col, ok := selectionBounds.newlineMarkerAt(src, limit, width, bound.Soft); ok && col < len(row) {
621621 toggleInverse(&row[col].Style)
622622 if cursorValid && cursor.Row == src && cursor.Col == col {
623623 cursorCovered = true
@@ -605,19 +605,19 @@ func (m *Mode) RenderRowsRange(start, end int, paint func(int, []renderer.Cell),
605 cursorCovered := false605 cursorCovered := false
606 if hasSelectionBounds {606 if hasSelectionBounds {
607 bound := d.snapshot.Bound(src)607 bound := d.snapshot.Bound(src)
608- limit := contentEndOf(row[:n], bound)608+ width := d.RowWidth(src)
609- if n < d.RowWidth(src) {609+ cells, rangeCells := row[:n], row
610- limit = d.contentEnd(src)610+ if n < width {
611- }611+ cells = d.Row(src)
612- r, ok := selectionBounds.rangeForCells(src, row, limit)612+ rangeCells = cells
613- if n < d.RowWidth(src) {
614- r, ok = selectionBounds.rangeForRow(d, src)
615 }613 }
614+ limit := contentEndOf(cells, bound)
615+ r, ok := selectionBounds.rangeForCells(src, rangeCells, limit)
616 if ok {616 if ok {
617 for x := max(r.Start, 0); x <= min(r.End, len(row)-1); x++ {617 for x := max(r.Start, 0); x <= min(r.End, len(row)-1); x++ {
618 toggleInverse(&row[x].Style)618 toggleInverse(&row[x].Style)
619 }619 }
620- if col, ok := selectionBounds.newlineMarkerAt(src, limit, d.RowWidth(src), bound.Soft); ok && col < len(row) {620+ if col, ok := selectionBounds.newlineMarkerAt(src, limit, width, bound.Soft); ok && col < len(row) {
621 toggleInverse(&row[col].Style)621 toggleInverse(&row[col].Style)
622 if cursorValid && cursor.Row == src && cursor.Col == col {622 if cursorValid && cursor.Row == src && cursor.Col == col {
623 cursorCovered = true623 cursorCovered = true

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