From 1a4692c33bea4ede69cfba2327463e0e6a505b59 Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Mon, 5 Feb 2024 08:03:14 +0100 Subject: [PATCH] Filter entries that start with whitespace --- src/history/file_backed.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/history/file_backed.rs b/src/history/file_backed.rs index 125fd4c3..018e7e1f 100644 --- a/src/history/file_backed.rs +++ b/src/history/file_backed.rs @@ -246,6 +246,14 @@ impl History for FileBackedHistory { let mut from_file = reader .lines() .map(|o| o.map(|i| decode_entry(&i))) + .filter(|e| { + if let Ok(entry) = e { + if entry.starts_with(' ') { + return false; + } + } + true + }) .collect::>>()?; if from_file.len() + own_entries.len() > self.capacity { (