From 73f10aaf43db07baa6ba8b20a97d35900b1e1a94 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 30 Apr 2023 06:48:09 +0530 Subject: [PATCH] clipboard kitten: Fix a bug causing the last MIME type available on the clipboard not being recognized when pasting with arbitrary MIME types --- docs/changelog.rst | 2 ++ kittens/clipboard/read.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 4e0cd6ef5..37c99016b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -40,6 +40,8 @@ Detailed list of changes - unicode_input kitten: Fix a regression in 0.28.0 that caused the order of recent and favorites entries to not be respected (:iss:`6214`) +- clipboard kitten: Fix a bug causing the last MIME type available on the clipboard not being recognized when pasting + 0.28.1 [2023-04-21] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kittens/clipboard/read.go b/kittens/clipboard/read.go index c9177e140..19a707b7a 100644 --- a/kittens/clipboard/read.go +++ b/kittens/clipboard/read.go @@ -343,7 +343,7 @@ func run_get_loop(opts *Options, args []string) (err error) { if reading_available_mimes { switch metadata["status"] { case "DATA": - available_mimes = strings.Split(utils.UnsafeBytesToString(payload), " ") + available_mimes = utils.Map(strings.TrimSpace, strings.Split(utils.UnsafeBytesToString(payload), " ")) case "OK": case "DONE": reading_available_mimes = false