From 6f1ffae48dc77af05d7df512fb2af4f7b130d0d5 Mon Sep 17 00:00:00 2001 From: Josh Hansen Date: Thu, 29 Jun 2023 14:54:50 -0700 Subject: [PATCH] Clear the buffer when annotation is complete, triggering the next file to load --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b6ca931..2e38e5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -443,7 +443,7 @@ fn main() { let path_guard = path.lock(); let path = path_guard.as_ref().unwrap(); - let buf = buf.lock(); + let mut buf = buf.lock(); annotations.clear(); annotations.push(Annotation { @@ -454,7 +454,7 @@ fn main() { }); write(&annotations, path.as_path()); - + buf.clear(); } Command::AnnotateSince(class) => { let end = *idx.lock(); @@ -484,6 +484,7 @@ fn main() { if annotation_complete(&annotations, buf.lock().len()) { write(&annotations, path.as_path()); + buf.lock().clear(); } } }