Skip to content

Commit a1b4dd8

Browse files
committed
fix(devtools): trim input text in chat panels
- Trim input text in NormalChatCodingPanel and SketchToolWindow - Prevent leading and trailing whitespace in user input - Improve consistency and reduce potential errors in code execution
1 parent 6fdfb8f commit a1b4dd8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/NormalChatCodingPanel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class NormalChatCodingPanel(private val chatCodingService: ChatCodingService, va
295295
}
296296

297297
fun setInput(trimMargin: String) {
298-
inputSection.text = trimMargin
298+
inputSection.text = trimMargin.trim()
299299
this.focusInput()
300300
}
301301

core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ open class SketchToolWindow(
264264
}
265265

266266
fun setInput(text: String) {
267-
inputSection.text = text
267+
inputSection.text = text.trim()
268268
}
269269

270270
fun createSingleTextView(text: String, language: String = "markdown"): DialogPanel {
@@ -420,7 +420,7 @@ open class SketchToolWindow(
420420
}
421421

422422
fun sendInput(text: String) {
423-
inputSection.text += "\n" + text
423+
inputSection.text += text.trim()
424424
ApplicationManager.getApplication().invokeLater {
425425
inputSection.send()
426426
}

0 commit comments

Comments
 (0)