@@ -19308,6 +19308,8 @@ impl Editor {
&& let Some(path) = path.to_str()
{
cx.write_to_clipboard(ClipboardItem::new_string(path.to_string()));
+ } else {
+ cx.propagate();
}
}
@@ -19321,6 +19323,8 @@ impl Editor {
&& let Some(path) = path.to_str()
{
cx.write_to_clipboard(ClipboardItem::new_string(path.to_string()));
+ } else {
+ cx.propagate();
}
}
@@ -28,7 +28,7 @@ use schemars::JsonSchema;
use serde::Deserialize;
use settings::Settings;
use std::sync::Arc;
-use zed_actions::outline::ToggleOutline;
+use zed_actions::{outline::ToggleOutline, workspace::CopyPath, workspace::CopyRelativePath};
use ui::{
BASE_REM_SIZE_IN_PX, IconButton, IconButtonShape, IconName, Tooltip, h_flex, prelude::*,
@@ -425,6 +425,16 @@ impl Render for BufferSearchBar {
active_searchable_item.relay_action(Box::new(ToggleOutline), window, cx);
}
}))
+ .on_action(cx.listener(|this, _: &CopyPath, window, cx| {
+ if let Some(active_searchable_item) = &mut this.active_searchable_item {
+ active_searchable_item.relay_action(Box::new(CopyPath), window, cx);
+ }
+ }))
+ .on_action(cx.listener(|this, _: &CopyRelativePath, window, cx| {
+ if let Some(active_searchable_item) = &mut this.active_searchable_item {
+ active_searchable_item.relay_action(Box::new(CopyRelativePath), window, cx);
+ }
+ }))
.when(replacement, |this| {
this.on_action(cx.listener(Self::toggle_replace))
.when(in_replace, |this| {