Add cursor position to feedback editor

Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Joseph Lyons 2023-01-25 14:20:23 -05:00
parent 44c7f162b6
commit f68f9f37ab
2 changed files with 17 additions and 1 deletions

View file

@ -1,4 +1,5 @@
use std::{
any::TypeId,
ops::{Range, RangeInclusive},
sync::Arc,
};
@ -358,6 +359,21 @@ impl Item for FeedbackEditor {
fn as_searchable(&self, handle: &ViewHandle<Self>) -> Option<Box<dyn SearchableItemHandle>> {
Some(Box::new(handle.clone()))
}
fn act_as_type(
&self,
type_id: TypeId,
self_handle: &ViewHandle<Self>,
_: &AppContext,
) -> Option<AnyViewHandle> {
if type_id == TypeId::of::<Self>() {
Some(self_handle.into())
} else if type_id == TypeId::of::<Editor>() {
Some((&self.editor).into())
} else {
None
}
}
}
impl SearchableItem for FeedbackEditor {