Rename ItemView
to Item
This commit is contained in:
parent
aced1e2315
commit
0efce8f70a
11 changed files with 122 additions and 135 deletions
|
@ -6264,7 +6264,7 @@ mod tests {
|
|||
#[gpui::test]
|
||||
fn test_navigation_history(cx: &mut gpui::MutableAppContext) {
|
||||
populate_settings(cx);
|
||||
use workspace::ItemView;
|
||||
use workspace::Item;
|
||||
let nav_history = Rc::new(RefCell::new(workspace::NavHistory::default()));
|
||||
let buffer = MultiBuffer::build_simple(&sample_text(30, 5, 'a'), cx);
|
||||
|
||||
|
@ -6283,7 +6283,7 @@ mod tests {
|
|||
editor.select_display_ranges(&[DisplayPoint::new(13, 0)..DisplayPoint::new(13, 3)], cx);
|
||||
let nav_entry = nav_history.borrow_mut().pop_backward().unwrap();
|
||||
editor.navigate(nav_entry.data.unwrap(), cx);
|
||||
assert_eq!(nav_entry.item_view.id(), cx.view_id());
|
||||
assert_eq!(nav_entry.item.id(), cx.view_id());
|
||||
assert_eq!(
|
||||
editor.selected_display_ranges(cx),
|
||||
&[DisplayPoint::new(3, 0)..DisplayPoint::new(3, 0)]
|
||||
|
@ -6309,7 +6309,7 @@ mod tests {
|
|||
);
|
||||
let nav_entry = nav_history.borrow_mut().pop_backward().unwrap();
|
||||
editor.navigate(nav_entry.data.unwrap(), cx);
|
||||
assert_eq!(nav_entry.item_view.id(), cx.view_id());
|
||||
assert_eq!(nav_entry.item.id(), cx.view_id());
|
||||
assert_eq!(
|
||||
editor.selected_display_ranges(cx),
|
||||
&[DisplayPoint::new(5, 0)..DisplayPoint::new(5, 0)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::fmt::Write;
|
|||
use std::path::PathBuf;
|
||||
use text::{Point, Selection};
|
||||
use util::ResultExt;
|
||||
use workspace::{ItemNavHistory, ItemView, ItemViewHandle, Settings, StatusItemView};
|
||||
use workspace::{Item, ItemHandle, ItemNavHistory, Settings, StatusItemView};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct BufferItemHandle(pub ModelHandle<Buffer>);
|
||||
|
@ -24,7 +24,7 @@ pub struct MultiBufferItemHandle(pub ModelHandle<MultiBuffer>);
|
|||
#[derive(Clone)]
|
||||
struct WeakMultiBufferItemHandle(WeakModelHandle<MultiBuffer>);
|
||||
|
||||
impl ItemView for Editor {
|
||||
impl Item for Editor {
|
||||
fn navigate(&mut self, data: Box<dyn std::any::Any>, cx: &mut ViewContext<Self>) {
|
||||
if let Some(data) = data.downcast_ref::<NavigationData>() {
|
||||
let buffer = self.buffer.read(cx).read(cx);
|
||||
|
@ -206,7 +206,7 @@ impl View for CursorPosition {
|
|||
impl StatusItemView for CursorPosition {
|
||||
fn set_active_pane_item(
|
||||
&mut self,
|
||||
active_pane_item: Option<&dyn ItemViewHandle>,
|
||||
active_pane_item: Option<&dyn ItemHandle>,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
if let Some(editor) = active_pane_item.and_then(|item| item.downcast::<Editor>()) {
|
||||
|
@ -279,7 +279,7 @@ impl View for DiagnosticMessage {
|
|||
impl StatusItemView for DiagnosticMessage {
|
||||
fn set_active_pane_item(
|
||||
&mut self,
|
||||
active_pane_item: Option<&dyn ItemViewHandle>,
|
||||
active_pane_item: Option<&dyn ItemHandle>,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
if let Some(editor) = active_pane_item.and_then(|item| item.downcast::<Editor>()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue