fix(clearer): if drop last item, wipe it from clipboard too

This commit is contained in:
yory8 2019-09-17 13:55:08 +02:00
parent 824b31c50f
commit 789a43de40

View file

@ -92,6 +92,13 @@ func main() {
} }
if selection != "" { 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 { if err := write(filter(history, selection), histfile); err != nil {
log.Fatal(err) log.Fatal(err)
} }