We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2c8211 commit 3649777Copy full SHA for 3649777
1 file changed
Core/Sources/SuggestionInjector/SuggestionInjector.swift
@@ -148,8 +148,10 @@ public struct SuggestionInjector {
148
let lastRemovedLine = content[safe: end.line]
149
let startLine = max(0, start.line)
150
let endLine = max(start.line, min(end.line, content.endIndex - 1))
151
- extraInfo.modifications.append(.deleted(startLine...endLine))
152
- content.removeSubrange(startLine...endLine)
+ if startLine < content.endIndex {
+ extraInfo.modifications.append(.deleted(startLine...endLine))
153
+ content.removeSubrange(startLine...endLine)
154
+ }
155
156
var toBeInserted = suggestionContent.breakLines(appendLineBreakToLastLine: true)
157
0 commit comments