only filter history if not empty

This commit is contained in:
yory8 2019-03-22 16:08:28 +01:00
parent ecfe78e04d
commit 63a247000b

View file

@ -74,6 +74,7 @@ func main() {
l := len(history) l := len(history)
if l > 0 {
// wl-paste will always give back the last copied text // wl-paste will always give back the last copied text
// (as long as the place we copied from is still running) // (as long as the place we copied from is still running)
if history[l-1] == text { if history[l-1] == text {
@ -89,6 +90,7 @@ func main() {
// remove duplicates // remove duplicates
history = filter(history, text) history = filter(history, text)
}
history = append(history, text) history = append(history, text)