diff options
author | Kyohei Uto <im@kyoheiu.dev> | 2024-01-20 06:49:31 +0900 |
---|---|---|
committer | Kyohei Uto <im@kyoheiu.dev> | 2024-01-20 06:49:31 +0900 |
commit | 74d34ae12c8b5fc36714c103b9b04a0a035ccb52 (patch) | |
tree | da7e33543efeec25a7e406071d812529115a5fa1 | |
parent | 50df35f0536c2b933a3a4e82c4bc6f46f9a5a58e (diff) |
Add :config to jump to config file directory
-rw-r--r-- | src/run.rs | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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" { |