terminal/search: Partially fix search in terminal.
There are two issues with search in terminal as is: - terminal's pane is not registered as a "legit" pane, so we dispatch buffer search bar::Deploy on the most recent "legit" pane. By legit I mean that workspace::active_pane will *never* return terminal pane as active. - We've had the implementation of as_searchable commented out. Duh! This commit fixes second issue. That means that if you drag the terminal over to the main editor pane (so that it's in a "legit" pane), it'll work. 1st issue still stands though.
This commit is contained in:
parent
3f06a05060
commit
b3d8b23139
4 changed files with 9 additions and 9 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -7762,6 +7762,7 @@ dependencies = [
|
||||||
"procinfo",
|
"procinfo",
|
||||||
"project",
|
"project",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
|
"search",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"settings",
|
"settings",
|
||||||
|
|
|
@ -13,7 +13,7 @@ editor = { path = "../editor" }
|
||||||
language = { path = "../language" }
|
language = { path = "../language" }
|
||||||
gpui = { path = "../gpui" }
|
gpui = { path = "../gpui" }
|
||||||
project = { path = "../project" }
|
project = { path = "../project" }
|
||||||
# search = { path = "../search" }
|
search = { path = "../search" }
|
||||||
settings = { path = "../settings" }
|
settings = { path = "../settings" }
|
||||||
theme = { path = "../theme" }
|
theme = { path = "../theme" }
|
||||||
util = { path = "../util" }
|
util = { path = "../util" }
|
||||||
|
|
|
@ -101,9 +101,9 @@ impl TerminalPanel {
|
||||||
})
|
})
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
});
|
});
|
||||||
// let buffer_search_bar = cx.build_view(search::BufferSearchBar::new);
|
let buffer_search_bar = cx.add_view(search::BufferSearchBar::new);
|
||||||
// pane.toolbar()
|
pane.toolbar()
|
||||||
// .update(cx, |toolbar, cx| toolbar.add_item(buffer_search_bar, cx));
|
.update(cx, |toolbar, cx| toolbar.add_item(buffer_search_bar, cx));
|
||||||
pane
|
pane
|
||||||
});
|
});
|
||||||
let subscriptions = vec![
|
let subscriptions = vec![
|
||||||
|
|
|
@ -28,7 +28,7 @@ use workspace::{
|
||||||
item::{BreadcrumbText, Item, ItemEvent},
|
item::{BreadcrumbText, Item, ItemEvent},
|
||||||
notifications::NotifyResultExt,
|
notifications::NotifyResultExt,
|
||||||
register_deserializable_item,
|
register_deserializable_item,
|
||||||
searchable::{SearchEvent, SearchOptions, SearchableItem},
|
searchable::{SearchEvent, SearchOptions, SearchableItem, SearchableItemHandle},
|
||||||
CloseActiveItem, NewCenterTerminal, Pane, ToolbarItemLocation, Workspace, WorkspaceId,
|
CloseActiveItem, NewCenterTerminal, Pane, ToolbarItemLocation, Workspace, WorkspaceId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -714,10 +714,9 @@ impl Item for TerminalView {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(search)
|
fn as_searchable(&self, handle: &View<Self>) -> Option<Box<dyn SearchableItemHandle>> {
|
||||||
// fn as_searchable(&self, handle: &View<Self>) -> Option<Box<dyn SearchableItemHandle>> {
|
Some(Box::new(handle.clone()))
|
||||||
// Some(Box::new(handle.clone()))
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
fn breadcrumb_location(&self) -> ToolbarItemLocation {
|
fn breadcrumb_location(&self) -> ToolbarItemLocation {
|
||||||
ToolbarItemLocation::PrimaryLeft
|
ToolbarItemLocation::PrimaryLeft
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue