From ea7905fa8e93a25e6cd5efe1094713586da20324 Mon Sep 17 00:00:00 2001 From: WanderingPenwing Date: Thu, 1 Aug 2024 17:23:14 +0200 Subject: [PATCH] listen for clipboard --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index acd5cd9..5320446 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,15 @@ impl History { } fn update(&mut self) { - //clipboard.get_text().unwrap() + let clip = self.clipboard.get_text().unwrap(); + + for entry in &self.entries { + if &clip == entry { + return + } + } + + self.entries.insert(0, clip); } async fn paste(&self) {