Skip to content

Commit 045dd42

Browse files
committed
Remove the traliing new line
1 parent b967471 commit 045dd42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Core/Sources/SuggestionWidget/SuggestionPanelContent/CodeBlockSuggestionPanel.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ struct CodeBlockSuggestionPanel: View {
241241
lastLine.utf16.startIndex,
242242
offsetBy: range.end.character
243243
)
244-
let leftover = String(lastLine.utf16.suffix(from: startIndex))
244+
var leftover = String(lastLine.utf16.suffix(from: startIndex))
245+
if leftover?.last?.isNewline ?? false {
246+
leftover?.removeLast(1)
247+
}
245248
return leftover ?? ""
246249
}
247250
}

0 commit comments

Comments
 (0)