assistant: Fix inline assistant not working for non-terminal panel views (#15864)

Fixes #15729

Release Notes:

- Fixed an issue where the terminal inline assistant would not appear
when opening a terminal in the center pane
([#15729](https://github.com/zed-industries/zed/issues/15729)).
This commit is contained in:
Bennet Bo Fenner 2024-08-06 18:41:54 +02:00 committed by GitHub
parent 33afbe9a94
commit 2e27448d5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -813,6 +813,11 @@ impl AssistantPanel {
.and_then(|item| item.act_as::<Editor>(cx))
{
Some(InlineAssistTarget::Editor(workspace_editor, true))
} else if let Some(terminal_view) = workspace
.active_item(cx)
.and_then(|item| item.act_as::<TerminalView>(cx))
{
Some(InlineAssistTarget::Terminal(terminal_view))
} else {
None
}