summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 4a5f1007..47a61b7f 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -39,9 +39,12 @@ impl<'a> Context<'a> {
}
/// Push a new component onto the compositor.
- pub fn push_layer(&mut self, component: Box<dyn crate::compositor::Component>) {
+ pub fn push_layer(&mut self, mut component: Box<dyn crate::compositor::Component>) {
self.callback = Some(Box::new(
|compositor: &mut Compositor, editor: &mut Editor| {
+ let size = compositor.size();
+ // trigger required_size on init
+ component.required_size((size.width, size.height));
compositor.push(component);
},
));