mirror of https://github.com/helix-editor/helix
Replace DAP vars popup, instead of adding new (#7034)
parent
06d7f5d100
commit
d5fe08ddb8
|
@ -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]
|
#[inline]
|
||||||
pub fn on_next_key(
|
pub fn on_next_key(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
|
@ -580,7 +580,7 @@ pub fn dap_variables(cx: &mut Context) {
|
||||||
|
|
||||||
let contents = Text::from(tui::text::Text::from(variables));
|
let contents = Text::from(tui::text::Text::from(variables));
|
||||||
let popup = Popup::new("dap-variables", contents);
|
let popup = Popup::new("dap-variables", contents);
|
||||||
cx.push_layer(Box::new(popup));
|
cx.replace_or_push_layer("dap-variables", popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dap_terminate(cx: &mut Context) {
|
pub fn dap_terminate(cx: &mut Context) {
|
||||||
|
|
Loading…
Reference in New Issue