Skip to content

Commit

Permalink
Add :config to jump to config file directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoheiu committed Jan 19, 2024
1 parent 50df35f commit 74d34ae
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 74d34ae

Please sign in to comment.