From eba0bbda2ee10e9ba53f01f1d324d2c4c82229d2 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sun, 18 Jul 2021 12:24:07 +0800 Subject: Resume last picker Inspired by space ' in doom emacs. --- helix-term/src/compositor.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'helix-term/src/compositor.rs') diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 5fcb552a..c2cfa3a7 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -74,6 +74,8 @@ type Terminal = tui::terminal::Terminal>; pub struct Compositor { layers: Vec>, terminal: Terminal, + + pub(crate) last_picker: Option>, } impl Compositor { @@ -83,6 +85,7 @@ impl Compositor { Ok(Self { layers: Vec::new(), terminal, + last_picker: None, }) } @@ -103,8 +106,8 @@ impl Compositor { self.layers.push(layer); } - pub fn pop(&mut self) { - self.layers.pop(); + pub fn pop(&mut self) -> Option> { + self.layers.pop() } pub fn handle_event(&mut self, event: Event, cx: &mut Context) -> bool { -- cgit v1.2.3-70-g09d2