aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/compositor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index bcb3e449..dc962e1f 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -16,6 +16,7 @@ pub enum EventResult {
}
use crate::job::Jobs;
+use crate::ui::picker;
use helix_view::Editor;
pub use helix_view::input::Event;
@@ -100,6 +101,11 @@ impl Compositor {
/// Add a layer to be rendered in front of all existing layers.
pub fn push(&mut self, mut layer: Box<dyn Component>) {
+ // immediately clear last_picker field to avoid excessive memory
+ // consumption for picker with many items
+ if layer.id() == Some(picker::ID) {
+ self.last_picker = None;
+ }
let size = self.size();
// trigger required_size on init
layer.required_size((size.width, size.height));