summaryrefslogtreecommitdiffstats
path: root/src/verb
diff options
context:
space:
mode:
authorAlexander Kastler <github@xaka.eu>2022-04-17 12:33:27 +0200
committerAlexander Kastler <github@xaka.eu>2022-04-17 12:33:27 +0200
commite757dfec3a878ae2f2745854175823cbb0ce2ccb (patch)
treeb78ad7315b23b4279187191be924a44ee0336eaa /src/verb
parent43a42fe7664874a73868b008216eb5146c71c952 (diff)
Add cfg for mv commands to separate between unix and windows
Diffstat (limited to 'src/verb')
-rw-r--r--src/verb/builtin.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/verb/builtin.rs b/src/verb/builtin.rs
index 2ec7f06..6b34ef5 100644
--- a/src/verb/builtin.rs
+++ b/src/verb/builtin.rs
@@ -151,18 +151,35 @@ pub fn builtin_verbs() -> Vec<Verb> {
StayInBroot,
)
.with_shortcut("md"),
+ #[cfg(unix)]
external(
"move {newpath}",
"mv {file} {newpath:path-from-parent}",
StayInBroot,
)
.with_shortcut("mv"),
+ #[cfg(windows)]
+ external(
+ "move {newpath}",
+ "cmd /c move /Y {file} {newpath:path-from-parent}",
+ StayInBroot,
+ )
+ .with_shortcut("mv"),
+ #[cfg(unix)]
external(
"move_to_panel",
"mv {file} {other-panel-directory}",
StayInBroot,
)
.with_shortcut("mvp"),
+ #[cfg(windows)]
+ external(
+ "move_to_panel",
+ "cmd /c move /Y {file} {other-panel-directory}",
+ StayInBroot,
+ )
+ .with_shortcut("mvp"),
+ #[cfg(unix)]
external(
"rename {new_filename:file-name}",
"mv {file} {parent}/{new_filename}",
@@ -170,6 +187,14 @@ pub fn builtin_verbs() -> Vec<Verb> {
)
.with_auto_exec(false)
.with_key(key!(f2)),
+ #[cfg(windows)]
+ external(
+ "rename {new_filename:file-name}",
+ "cmd /c move /Y {file} {parent}/{new_filename}",
+ StayInBroot,
+ )
+ .with_auto_exec(false)
+ .with_key(key!(f2)),
internal_bang(start_end_panel)
.with_key(key!(ctrl-p)),
// the char keys for mode_input are handled differently as they're not