diff options
author | A-Walrus | 2023-05-13 15:44:25 +0000 |
---|---|---|
committer | GitHub | 2023-05-13 15:44:25 +0000 |
commit | d5fe08ddb8bf1408a1a92d39a63b51cd16d83255 (patch) | |
tree | 2f0d90571d2d8023c5e92db9bcf6d9853e7267c0 /helix-term/src/commands.rs | |
parent | 06d7f5d100fdcc99f4cdfda879898b2d488d8d7c (diff) |
Replace DAP vars popup, instead of adding new (#7034)
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 882a8a1d..7d86bc0b 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -97,6 +97,13 @@ impl<'a> Context<'a> { })); } + /// Call `replace_or_push` on the Compositor + pub fn replace_or_push_layer<T: Component>(&mut self, id: &'static str, component: T) { + self.callback = Some(Box::new(move |compositor: &mut Compositor, _| { + compositor.replace_or_push(id, component); + })); + } + #[inline] pub fn on_next_key( &mut self, |