File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
packages/tui/internal/components/chat Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -134,15 +134,18 @@ func (m *messagesComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
134134 }
135135
136136 case tea.MouseReleaseMsg :
137- if m .selection != nil && len (m .clipboard ) > 0 {
138- content := strings .Join (m .clipboard , "\n " )
137+ if m .selection != nil {
139138 m .selection = nil
140- m .clipboard = []string {}
141- return m , tea .Sequence (
142- m .renderView (),
143- app .SetClipboard (content ),
144- toast .NewSuccessToast ("Copied to clipboard" ),
145- )
139+ if len (m .clipboard ) > 0 {
140+ content := strings .Join (m .clipboard , "\n " )
141+ m .clipboard = []string {}
142+ return m , tea .Sequence (
143+ m .renderView (),
144+ app .SetClipboard (content ),
145+ toast .NewSuccessToast ("Copied to clipboard" ),
146+ )
147+ }
148+ return m , m .renderView ()
146149 }
147150 case tea.WindowSizeMsg :
148151 effectiveWidth := msg .Width - 4
You can’t perform that action at this time.
0 commit comments