debugger: Remember focused item (#30722)
Release Notes: - Debugger Beta: the `debug panel: toggle focus` action now preserves the debug panel's focused item.
This commit is contained in:
@@ -81,6 +81,10 @@ impl RunningState {
|
||||
pub(crate) fn thread_id(&self) -> Option<ThreadId> {
|
||||
self.thread_id
|
||||
}
|
||||
|
||||
pub(crate) fn active_pane(&self) -> Option<&Entity<Pane>> {
|
||||
self.active_pane.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
impl Render for RunningState {
|
||||
@@ -502,20 +506,15 @@ impl DebugTerminal {
|
||||
|
||||
impl gpui::Render for DebugTerminal {
|
||||
fn render(&mut self, _window: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
|
||||
if let Some(terminal) = self.terminal.clone() {
|
||||
terminal.into_any_element()
|
||||
} else {
|
||||
div().track_focus(&self.focus_handle).into_any_element()
|
||||
}
|
||||
div()
|
||||
.size_full()
|
||||
.track_focus(&self.focus_handle)
|
||||
.children(self.terminal.clone())
|
||||
}
|
||||
}
|
||||
impl Focusable for DebugTerminal {
|
||||
fn focus_handle(&self, cx: &App) -> FocusHandle {
|
||||
if let Some(terminal) = self.terminal.as_ref() {
|
||||
return terminal.focus_handle(cx);
|
||||
} else {
|
||||
self.focus_handle.clone()
|
||||
}
|
||||
fn focus_handle(&self, _cx: &App) -> FocusHandle {
|
||||
self.focus_handle.clone()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user