Add an action to toggle the outline from the buffer search bar (#25225)
This was annoying. Release Notes: - Fixed a bug where you couldn't open the outline modal when focus was in the buffer search bar.
This commit is contained in:
parent
0c0201c79f
commit
cc46a1fe30
5 changed files with 20 additions and 3 deletions
|
@ -40,6 +40,7 @@ theme.workspace = true
|
|||
ui.workspace = true
|
||||
util.workspace = true
|
||||
workspace.workspace = true
|
||||
zed_actions.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
client = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
@ -28,6 +28,7 @@ use serde::Deserialize;
|
|||
use settings::Settings;
|
||||
use std::sync::Arc;
|
||||
use theme::ThemeSettings;
|
||||
use zed_actions::outline::ToggleOutline;
|
||||
|
||||
use ui::{
|
||||
h_flex, prelude::*, utils::SearchInputWidth, IconButton, IconButtonShape, IconName, Tooltip,
|
||||
|
@ -482,6 +483,11 @@ impl Render for BufferSearchBar {
|
|||
.on_action(cx.listener(Self::dismiss))
|
||||
.on_action(cx.listener(Self::select_next_match))
|
||||
.on_action(cx.listener(Self::select_prev_match))
|
||||
.on_action(cx.listener(|this, _: &ToggleOutline, window, cx| {
|
||||
if let Some(active_searchable_item) = &mut this.active_searchable_item {
|
||||
active_searchable_item.relay_action(Box::new(ToggleOutline), window, cx);
|
||||
}
|
||||
}))
|
||||
.when(self.supported_options(cx).replacement, |this| {
|
||||
this.on_action(cx.listener(Self::toggle_replace))
|
||||
.when(in_replace, |this| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue