mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 09:42:34 +02:00
Copy func in findings
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const (
|
||||
popupH = 20
|
||||
)
|
||||
|
||||
func writeClipboard(text string) {
|
||||
func WriteClipboard(text string) {
|
||||
encoded := base64.StdEncoding.EncodeToString([]byte(text))
|
||||
fmt.Fprintf(os.Stderr, "\033]52;c;%s\a", encoded)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
||||
switch {
|
||||
case kp.String() == "enter":
|
||||
if item, ok := m.list.SelectedItem().(copyItem); ok {
|
||||
writeClipboard(m.extract(item.id))
|
||||
WriteClipboard(m.extract(item.id))
|
||||
}
|
||||
m.open = false
|
||||
return m, nil
|
||||
|
||||
Reference in New Issue
Block a user