summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyohei Uto <im@kyoheiu.dev>2024-01-20 06:49:31 +0900
committerKyohei Uto <im@kyoheiu.dev>2024-01-20 06:49:31 +0900
commit74d34ae12c8b5fc36714c103b9b04a0a035ccb52 (patch)
treeda7e33543efeec25a7e406071d812529115a5fa1
parent50df35f0536c2b933a3a4e82c4bc6f46f9a5a58e (diff)
Add :config to jump to config file directory
-rw-r--r--src/run.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/run.rs b/src/run.rs
index 3402086..0362ad0 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -2137,6 +2137,33 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> {
state.empty_trash(&screen)?;
break 'command;
}
+ "config" => {
+ //move to the directory that contains
+ //config path
+ state.layout.nums.reset();
+ if let Some(ref config_path) =
+ state.config_path
+ {
+ if let Err(e) = state.chdir(
+ config_path
+ .clone()
+ .parent()
+ .unwrap(),
+ Move::Jump,
+ ) {
+ print_warning(
+ e,
+ state.layout.y,
+ );
+ }
+ } else {
+ print_warning(
+ "Cannot find the config path.",
+ state.layout.y,
+ )
+ }
+ break 'command;
+ }
_ => {}
}
} else if commands.len() == 2 && command == "cd" {