Skip to content

Commit

Permalink
chore: rename commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ankddev committed Dec 19, 2024
1 parent 5c50039 commit 5716b37
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion crates/editor/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ gpui::actions!(
Copy,
CopyFileLocation,
CopyFileName,
CopyFileNameWithExtension,
CopyFileNameWithoutExtension,
CopyHighlightJson,
CopyPath,
CopyPermalinkToLine,
Expand Down
4 changes: 2 additions & 2 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11334,7 +11334,7 @@ impl Editor {
}
}

pub fn copy_file_name(&mut self, _: &CopyFileName, cx: &mut ViewContext<Self>) {
pub fn copy_file_name_without_extension(&mut self, _: &CopyFileNameWithoutExtension, cx: &mut ViewContext<Self>) {
if let Some(file) = self.target_file(cx) {
if let Some(file_stem) = file.path().file_stem() {
if let Some(name) = file_stem.to_str() {
Expand All @@ -11344,7 +11344,7 @@ impl Editor {
}
}

pub fn copy_file_name_with_extension(&mut self, _: &CopyFileNameWithExtension, cx: &mut ViewContext<Self>) {
pub fn copy_file_name(&mut self, _: &CopyFileName, cx: &mut ViewContext<Self>) {
if let Some(file) = self.target_file(cx) {
if let Some(file_name) = file.path().file_name() {
if let Some(name) = file_name.to_str() {
Expand Down
2 changes: 1 addition & 1 deletion crates/editor/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl EditorElement {
register_action(view, cx, Editor::copy_path);
register_action(view, cx, Editor::copy_relative_path);
register_action(view, cx, Editor::copy_file_name);
register_action(view, cx, Editor::copy_file_name_with_extension);
register_action(view, cx, Editor::copy_file_name_without_extension);
register_action(view, cx, Editor::copy_highlight_json);
register_action(view, cx, Editor::copy_permalink_to_line);
register_action(view, cx, Editor::open_permalink_to_line);
Expand Down
12 changes: 6 additions & 6 deletions crates/project_panel/src/project_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ actions!(
CopyPath,
CopyRelativePath,
CopyFileName,
CopyFileNameWithExtension,
CopyFileNameWithoutExtension,
Duplicate,
RevealInFileManager,
RemoveFromProject,
Expand Down Expand Up @@ -679,8 +679,8 @@ impl ProjectPanel {
.separator()
.action("Copy Path", Box::new(CopyPath))
.action("Copy Relative Path", Box::new(CopyRelativePath))
.action("Copy File Name", Box::new(CopyFileName))
.action("Copy File Name with Extension", Box::new(CopyFileNameWithExtension))
.action("Copy File Name without Extension", Box::new(CopyFileName))
.action("Copy File Name", Box::new(CopyFileNameWithoutExtension))
.separator()
.action("Rename", Box::new(Rename))
.when(!is_root & !is_remote, |menu| {
Expand Down Expand Up @@ -1963,7 +1963,7 @@ impl ProjectPanel {
}
}

fn copy_file_name(&mut self, _: &CopyFileName, cx: &mut ViewContext<Self>) {
fn copy_file_name_without_extension(&mut self, _: &CopyFileNameWithoutExtension, cx: &mut ViewContext<Self>) {
let file_names = {
let project = self.project.read(cx);
self.marked_entries()
Expand All @@ -1980,7 +1980,7 @@ impl ProjectPanel {
}
}

fn copy_file_name_with_extension(&mut self, _: &CopyFileNameWithExtension, cx: &mut ViewContext<Self>) {
fn copy_file_name(&mut self, _: &CopyFileName, cx: &mut ViewContext<Self>) {
let file_names = {
let project = self.project.read(cx);
self.marked_entries()
Expand Down Expand Up @@ -3964,7 +3964,7 @@ impl Render for ProjectPanel {
.on_action(cx.listener(Self::copy_path))
.on_action(cx.listener(Self::copy_relative_path))
.on_action(cx.listener(Self::copy_file_name))
.on_action(cx.listener(Self::copy_file_name_with_extension))
.on_action(cx.listener(Self::copy_file_name_without_extension))
.on_action(cx.listener(Self::new_search_in_directory))
.on_action(cx.listener(Self::unfold_directory))
.on_action(cx.listener(Self::fold_directory))
Expand Down
6 changes: 3 additions & 3 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, CopyFileNameWithExtension, NewFile, NewTerminal, OpenInTerminal, OpenTerminal,
CloseWindow, CopyPath, CopyRelativePath, CopyFileName, CopyFileNameWithoutExtension, NewFile, NewTerminal, OpenInTerminal, OpenTerminal,
OpenVisible, SplitDirection, ToggleFileFinder, ToggleProjectSymbols, ToggleZoom, Workspace,
};
use anyhow::Result;
Expand Down Expand Up @@ -2372,8 +2372,8 @@ impl Pane {
})
.when_some(relative_path.clone(), |menu, relative_path| {
menu.entry(
"Copy File Name with Extension",
Some(Box::new(CopyFileNameWithExtension)),
"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(
Expand Down
2 changes: 1 addition & 1 deletion crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ actions!(
CopyPath,
CopyRelativePath,
CopyFileName,
CopyFileNameWithExtension,
CopyFileNameWithoutExtension,
Feedback,
FollowNextCollaborator,
NewCenterTerminal,
Expand Down

0 comments on commit 5716b37

Please sign in to comment.