1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Fix bug in LineNumberOfLine

This fixes a regression that was introduced in 73c7dc9c5d.
This commit is contained in:
Stefan Haller
2023-08-09 17:28:43 +02:00
parent bf699d3a79
commit 73b68927af
2 changed files with 3 additions and 3 deletions

View File

@ -97,12 +97,12 @@ func (self *Patch) LineNumberOfLine(idx int) int {
idxInHunk := idx - hunkStartIdx
if idxInHunk == 0 {
return hunk.oldStart
return hunk.newStart
}
lines := hunk.bodyLines[:idxInHunk-1]
offset := nLinesWithKind(lines, []PatchLineKind{ADDITION, CONTEXT})
return hunk.oldStart + offset
return hunk.newStart + offset
}
// Returns hunk index containing the line at the given patch line index