fix(clearer): if drop last item, wipe it from clipboard too
This commit is contained in:
parent
824b31c50f
commit
789a43de40
1 changed files with 7 additions and 0 deletions
7
main.go
7
main.go
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue