diff --git a/src/main/kotlin/app/git/StatusManager.kt b/src/main/kotlin/app/git/StatusManager.kt index 6f1cf3a..f6317db 100644 --- a/src/main/kotlin/app/git/StatusManager.kt +++ b/src/main/kotlin/app/git/StatusManager.kt @@ -126,7 +126,7 @@ class StatusManager @Inject constructor( // Restore previously removed lines to the index for (line in removedLines) { // Check how many lines before this one have been deleted - val previouslyRemovedLines = addedLines.count { it.newLineNumber <= line.newLineNumber } - 1 + val previouslyRemovedLines = addedLines.count { it.newLineNumber < line.newLineNumber } textLines.add(line.newLineNumber + linesAdded - previouslyRemovedLines, line.text.withoutLineEnding) linesAdded++ }