Fixed unstage hunk not working properly when having context lines inbetween changes
This commit is contained in:
parent
2e157aa773
commit
ad55f41f58
@ -195,7 +195,9 @@ class StatusManager @Inject constructor(
|
||||
|
||||
// Restore previously removed lines to the index
|
||||
for (line in removedLines) {
|
||||
textLines.add(line.newLineNumber + linesAdded, line.text.withoutLineEnding)
|
||||
// Check how many lines before this one have been deleted
|
||||
val previouslyRemovedLines = addedLines.count { it.newLineNumber <= line.newLineNumber } - 1
|
||||
textLines.add(line.newLineNumber + linesAdded - previouslyRemovedLines, line.text.withoutLineEnding)
|
||||
linesAdded++
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user