From 789a43de4026f75f1a1178837f3ac512d07404e4 Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Tue, 17 Sep 2019 13:55:08 +0200 Subject: [PATCH] fix(clearer): if drop last item, wipe it from clipboard too --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 3197175..1ba76f3 100644 --- a/main.go +++ b/main.go @@ -92,6 +92,13 @@ func main() { } if selection != "" { + if selection == history[len(history)-1] { + // it's the latest item + // in this case, wl-copy is still serving the copy, so wipe it + if err := exec.Command("wl-copy", "-c").Run(); err != nil { + log.Fatal(err) + } + } if err := write(filter(history, selection), histfile); err != nil { log.Fatal(err) }