Skip to content

Commit d0d1245

Browse files
committed
Keep spaces in code
1 parent 86aed4e commit d0d1245

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Core/Sources/Service/SuggestionCommandHandler/WindowBaseCommandHandler.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ struct WindowBaseCommandHandler: SuggestionCommandHandler {
209209
try? await chat.chatGPTService.send(
210210
content: """
211211
```\(codeLanguage.rawValue)
212-
\(removeContinuousSpaces(from: code))
212+
\(code)
213213
```
214214
""",
215215
summary: "Explain selected code from `\(selection.start.line + 1):\(selection.start.character + 1)` to `\(selection.end.line + 1):\(selection.end.character + 1)`."
@@ -257,7 +257,7 @@ struct WindowBaseCommandHandler: SuggestionCommandHandler {
257257
\(language.isEmpty ? "" : "You must always reply in \(language)")
258258
You are a senior programmer, you will answer my questions concisely about the code below, or modify it according to my requests. When you receive a modification request, reply with the modified code in a code block.
259259
```\(codeLanguage.rawValue)
260-
\(removeContinuousSpaces(from: code))
260+
\(code)
261261
```
262262
"""
263263
}()
@@ -282,7 +282,3 @@ struct WindowBaseCommandHandler: SuggestionCommandHandler {
282282
presenter.presentChatGPTConversation(fileURL: fileURL)
283283
}
284284
}
285-
286-
func removeContinuousSpaces(from string: String) -> String {
287-
return string.replacingOccurrences(of: " +", with: " ", options: .regularExpression)
288-
}

0 commit comments

Comments
 (0)