feat: Enhance clipboard manager with logging, search, and status commands
This commit is contained in:
@ -8,10 +8,17 @@ import (
|
||||
|
||||
func Summary(data []byte, format clipboard.Format) string {
|
||||
if format == clipboard.FmtText {
|
||||
if len(data) > 40 {
|
||||
return string(data[:40]) + "..."
|
||||
// Remove newlines for summary
|
||||
clean := make([]byte, 0, len(data))
|
||||
for _, b := range data {
|
||||
if b != '\n' && b != '\r' {
|
||||
clean = append(clean, b)
|
||||
}
|
||||
}
|
||||
return string(data)
|
||||
if len(clean) > 40 {
|
||||
return string(clean[:40]) + "..."
|
||||
}
|
||||
return string(clean)
|
||||
}
|
||||
if format == clipboard.FmtImage {
|
||||
return "[image] " + strconv.Itoa(len(data)) + " bytes"
|
||||
|
Reference in New Issue
Block a user