don't add empty text to history

main
Jordan Orelli 10 months ago
parent 1153c2dc49
commit 70e40cb7ae

@ -8,7 +8,11 @@ impl History {
} }
pub fn add<S: Into<String>>(&mut self, event: S) { pub fn add<S: Into<String>>(&mut self, event: S) {
self.events.push(event.into()); let text = event.into();
if text.is_empty() {
return;
}
self.events.push(text);
} }
pub fn look_back(&self, idx: usize) -> Option<&str> { pub fn look_back(&self, idx: usize) -> Option<&str> {

Loading…
Cancel
Save