mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Fix bug in LineNumberOfLine
This fixes a regression that was introduced in 73c7dc9c5d
.
This commit is contained in:
parent
bf699d3a79
commit
73b68927af
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue