We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9cc75f commit 5ac2581Copy full SHA for 5ac2581
1 file changed
hooks/jsonnet-fmt-hook/main.go
@@ -81,6 +81,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
81
82
const maxShowLine = 3
83
const omissionText = "...\n"
84
+ lastDiffIdx := len(diffs) - 1
85
86
for i, diff := range diffs {
87
text := diff.Text
@@ -100,7 +101,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
100
101
102
if i == 0 {
103
showTail = true
- } else if i == (len(diffs) - 1) {
104
+ } else if i == lastDiffIdx {
105
showHead = true
106
} else {
107
0 commit comments