From 8edfb70fb8cb2c0988d8c925e4214f31ae273284 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 25 Mar 2023 10:35:43 -0700 Subject: [PATCH] Fixed a minor bug --- src/promptbuffer.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/promptbuffer.rs b/src/promptbuffer.rs index 3045f6a..31bdac8 100644 --- a/src/promptbuffer.rs +++ b/src/promptbuffer.rs @@ -40,6 +40,10 @@ impl PromptBuffer { self.buffer_changed = false; if s != "" { self.hist.push_back(s.clone()); } + while self.hist.len() > self.hist_maxlen { + self.hist.pop_front(); + } + return s; }