vim: Fix search in the Assistant (#20258)
Closes #17704 Release Notes: - vim: Fix search in the assistant panel
This commit is contained in:
parent
c527f2e212
commit
4bf6fb217e
5 changed files with 48 additions and 17 deletions
|
@ -64,6 +64,7 @@ use serde::{Deserialize, Serialize};
|
|||
use settings::{update_settings_file, Settings};
|
||||
use smol::stream::StreamExt;
|
||||
use std::{
|
||||
any::TypeId,
|
||||
borrow::Cow,
|
||||
cmp,
|
||||
ops::{ControlFlow, Range},
|
||||
|
@ -4186,6 +4187,21 @@ impl Item for ContextEditor {
|
|||
fn deactivated(&mut self, cx: &mut ViewContext<Self>) {
|
||||
self.editor.update(cx, Item::deactivated)
|
||||
}
|
||||
|
||||
fn act_as_type<'a>(
|
||||
&'a self,
|
||||
type_id: TypeId,
|
||||
self_handle: &'a View<Self>,
|
||||
_: &'a AppContext,
|
||||
) -> Option<AnyView> {
|
||||
if type_id == TypeId::of::<Self>() {
|
||||
Some(self_handle.to_any())
|
||||
} else if type_id == TypeId::of::<Editor>() {
|
||||
Some(self.editor.to_any())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SearchableItem for ContextEditor {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue