diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-03 16:56:31 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-03 16:56:31 +0300 |
| commit | 76f14ce4a376bbbb99c79cc2090c067b5ba28484 (patch) | |
| tree | 6922620541ece02f849d6f50a4f371720f2ce298 /helpfuncs.go | |
| parent | 0f5bbaa94390cd4d11facc8b2e7fb825b128ef31 (diff) | |
Enha: detailed error
Diffstat (limited to 'helpfuncs.go')
| -rw-r--r-- | helpfuncs.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/helpfuncs.go b/helpfuncs.go index 849b0a0..49069a2 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -22,6 +22,28 @@ func isASCII(s string) bool { return true } +// refreshChatDisplay updates the chat display based on current character view +// It filters messages for the character the user is currently "writing as" +// and updates the textView with the filtered conversation +func refreshChatDisplay() { + // Determine which character's view to show + viewingAs := cfg.UserRole + if cfg.WriteNextMsgAs != "" { + viewingAs = cfg.WriteNextMsgAs + } + // Filter messages for this character + filteredMessages := filterMessagesForCharacter(chatBody.Messages, viewingAs) + displayText := chatToText(filteredMessages, cfg.ShowSys) + // Use QueueUpdate for thread-safe UI updates + app.QueueUpdate(func() { + textView.SetText(displayText) + colorText() + if scrollToEndEnabled { + textView.ScrollToEnd() + } + }) +} + func colorText() { text := textView.GetText(false) quoteReplacer := strings.NewReplacer( |
