Fix: whitespace adjestment
This commit is contained in:
9
bot.go
9
bot.go
@@ -855,7 +855,14 @@ func chatRound(r *models.ChatRoundReq) error {
|
|||||||
chatBody.Messages = append(chatBody.Messages, models.RoleMsg{
|
chatBody.Messages = append(chatBody.Messages, models.RoleMsg{
|
||||||
Role: botPersona, Content: "",
|
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, roleToIcon(botPersona))
|
||||||
fmt.Fprint(textView, "[-:-:-]\n")
|
fmt.Fprint(textView, "[-:-:-]\n")
|
||||||
if cfg.ThinkUse && !strings.Contains(cfg.CurrentAPI, "v1") {
|
if cfg.ThinkUse && !strings.Contains(cfg.CurrentAPI, "v1") {
|
||||||
|
|||||||
Reference in New Issue
Block a user