summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-23 14:15:17 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-23 14:15:17 +0300
commite3bd6f219f0f108fede8bcfd8326888801edeed7 (patch)
tree9d817ca6105526900d920db05df3398db0218a4a
parentae62c2c8d86025bb9cfb30dc88d5c950e7b15c2c (diff)
Fix: whitespace adjestment
-rw-r--r--bot.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/bot.go b/bot.go
index 085fc39..de75b15 100644
--- a/bot.go
+++ b/bot.go
@@ -855,7 +855,14 @@ func chatRound(r *models.ChatRoundReq) error {
chatBody.Messages = append(chatBody.Messages, models.RoleMsg{
Role: botPersona, Content: "",
})
- fmt.Fprintf(textView, "\n[-:-:b](%d) ", msgIdx)
+ nl := "\n\n"
+ prevText := textView.GetText(true)
+ if strings.HasSuffix(prevText, nl) {
+ nl = ""
+ } else if strings.HasSuffix(prevText, "\n") {
+ nl = "\n"
+ }
+ fmt.Fprintf(textView, "%s[-:-:b](%d) ", nl, msgIdx)
fmt.Fprint(textView, roleToIcon(botPersona))
fmt.Fprint(textView, "[-:-:-]\n")
if cfg.ThinkUse && !strings.Contains(cfg.CurrentAPI, "v1") {