Skip to content

Commit

Permalink
chore: remove commands for copying file name from tab's menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ankddev committed Dec 19, 2024
1 parent 5716b37 commit e233e1d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
28 changes: 1 addition & 27 deletions crates/workspace/src/pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
notifications::NotifyResultExt,
toolbar::Toolbar,
workspace_settings::{AutosaveSetting, TabBarSettings, WorkspaceSettings},
CloseWindow, CopyPath, CopyRelativePath, CopyFileName, CopyFileNameWithoutExtension, NewFile, NewTerminal, OpenInTerminal, OpenTerminal,
CloseWindow, CopyPath, CopyRelativePath, NewFile, NewTerminal, OpenInTerminal, OpenTerminal,
OpenVisible, SplitDirection, ToggleFileFinder, ToggleProjectSymbols, ToggleZoom, Workspace,
};
use anyhow::Result;
Expand Down Expand Up @@ -2357,32 +2357,6 @@ impl Pane {
}),
)
})
.when_some(relative_path.clone(), |menu, relative_path| {
menu.entry(
"Copy File Name",
Some(Box::new(CopyFileName)),
cx.handler_for(&pane, move |_, cx| {
if let Some(name) = relative_path.file_stem() {
cx.write_to_clipboard(ClipboardItem::new_string(
name.to_string_lossy().to_string(),
));
}
}),
)
})
.when_some(relative_path.clone(), |menu, relative_path| {
menu.entry(
"Copy File Name without Extension",
Some(Box::new(CopyFileNameWithoutExtension)),
cx.handler_for(&pane, move |_, cx| {
if let Some(name) = relative_path.file_name() {
cx.write_to_clipboard(ClipboardItem::new_string(
name.to_string_lossy().to_string(),
));
}
}),
)
})
.map(pin_tab_entries)
.separator()
.entry(
Expand Down
2 changes: 0 additions & 2 deletions crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ actions!(
CloseWindow,
CopyPath,
CopyRelativePath,
CopyFileName,
CopyFileNameWithoutExtension,
Feedback,
FollowNextCollaborator,
NewCenterTerminal,
Expand Down

0 comments on commit e233e1d

Please sign in to comment.