tab_switcher: Add support for tab switcher in assistant panel (#15475)
Additionally, I've generalized the implementation of tab switcher so that - instead of explicitly listing panels it supports (at the time of writing it was just the terminal panel and nothing else), it now relies on Panel::pane trait method. As long as that's implemented, you get a tab switcher support for free. Release Notes: - Added support for tab switcher in Assistant panel.
This commit is contained in:
parent
0540291204
commit
530feecdaa
6 changed files with 35 additions and 32 deletions
|
@ -686,13 +686,11 @@ impl AssistantPanel {
|
|||
.focus_handle(cx)
|
||||
.contains_focused(cx)
|
||||
{
|
||||
if let Some(terminal_view) = terminal_panel
|
||||
.read(cx)
|
||||
.pane()
|
||||
.read(cx)
|
||||
.active_item()
|
||||
.and_then(|t| t.downcast::<TerminalView>())
|
||||
{
|
||||
if let Some(terminal_view) = terminal_panel.read(cx).pane().and_then(|pane| {
|
||||
pane.read(cx)
|
||||
.active_item()
|
||||
.and_then(|t| t.downcast::<TerminalView>())
|
||||
}) {
|
||||
return Some(InlineAssistTarget::Terminal(terminal_view));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue