on main help sign in
fix: should also copy on `y` (additionally to `c`) (#1989)
9622c25Andrey Nering
internal/ui/chat/assistant.go+1−1
@@ -258,7 +258,7 @@ func (a *AssistantMessageItem) HandleMouseClick(btn ansi.MouseButton, x, y int)
258
258
259// HandleKeyEvent implements KeyEventHandler.
259// HandleKeyEvent implements KeyEventHandler.
260func (a *AssistantMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
260func (a *AssistantMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
261− if key.String() == "c" {
261+ if k := key.String(); k == "c" || k == "y" {
262 text := a.message.Content().Text
262 text := a.message.Content().Text
263 return true, common.CopyToClipboard(text, "Message copied to clipboard")
263 return true, common.CopyToClipboard(text, "Message copied to clipboard")
264 }
264 }
internal/ui/chat/tools.go+1−1
@@ -420,7 +420,7 @@ func (t *baseToolMessageItem) HandleMouseClick(btn ansi.MouseButton, x, y int) b
420
420
421// HandleKeyEvent implements KeyEventHandler.
421// HandleKeyEvent implements KeyEventHandler.
422func (t *baseToolMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
422func (t *baseToolMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
423− if key.String() == "c" {
423+ if k := key.String(); k == "c" || k == "y" {
424 text := t.formatToolForCopy()
424 text := t.formatToolForCopy()
425 return true, common.CopyToClipboard(text, "Tool content copied to clipboard")
425 return true, common.CopyToClipboard(text, "Tool content copied to clipboard")
426 }
426 }
internal/ui/chat/user.go+1−1
@@ -96,7 +96,7 @@ func (m *UserMessageItem) renderAttachments(width int) string {
96
96
97// HandleKeyEvent implements KeyEventHandler.
97// HandleKeyEvent implements KeyEventHandler.
98func (m *UserMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
98func (m *UserMessageItem) HandleKeyEvent(key tea.KeyMsg) (bool, tea.Cmd) {
99− if key.String() == "c" {
99+ if k := key.String(); k == "c" || k == "y" {
100 text := m.message.Content().Text
100 text := m.message.Content().Text
101 return true, common.CopyToClipboard(text, "Message copied to clipboard")
101 return true, common.CopyToClipboard(text, "Message copied to clipboard")
102 }
102 }