Skip to content

Commit bd263ec

Browse files
committed
refactor: drop unused hunk highlight helpers
1 parent 653ebaf commit bd263ec

1 file changed

Lines changed: 0 additions & 34 deletions

File tree

internal/ui/follow.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -61,40 +61,6 @@ func changedLineKeys(oldSigs []uint64, newHunks []internal.DiffHunk) map[lineKey
6161
return changed
6262
}
6363

64-
// hunkFingerprints hashes each hunk by rendered line semantics, excluding headers.
65-
func hunkFingerprints(hunks []internal.DiffHunk) []uint64 {
66-
sigs := make([]uint64, 0, len(hunks))
67-
for _, hunk := range hunks {
68-
hasher := fnv.New64a()
69-
for _, line := range hunk.Lines {
70-
_, _ = hasher.Write([]byte{byte(line.Type), 0})
71-
_, _ = hasher.Write([]byte(line.Content))
72-
_, _ = hasher.Write([]byte{0})
73-
}
74-
sigs = append(sigs, hasher.Sum64())
75-
}
76-
return sigs
77-
}
78-
79-
// changedHunkIndices finds every hunk whose fingerprint count exceeds the previous snapshot.
80-
func changedHunkIndices(oldSigs []uint64, newHunks []internal.DiffHunk) []int {
81-
seen := make(map[uint64]int, len(oldSigs))
82-
for _, sig := range oldSigs {
83-
seen[sig]++
84-
}
85-
86-
var changed []int
87-
for i, sig := range hunkFingerprints(newHunks) {
88-
if seen[sig] > 0 {
89-
seen[sig]--
90-
continue
91-
}
92-
changed = append(changed, i)
93-
}
94-
95-
return changed
96-
}
97-
9864
// hunkVisualOffset counts rendered rows before the target line for follow-mode scrolling.
9965
func hunkVisualOffset(file *internal.FileDiff, hunkIdx, lineIdx, width int) int {
10066
if file == nil || hunkIdx < 0 || lineIdx < 0 {

0 commit comments

Comments
 (0)