If file is passed on command line, show parent folder and select it
This commit is contained in:
parent
3460c2c106
commit
2095d3c7f2
1 changed files with 12 additions and 0 deletions
12
src/app.rs
12
src/app.rs
|
|
@ -1604,6 +1604,18 @@ impl Application for App {
|
|||
let mut commands = vec![app.update_config()];
|
||||
|
||||
for location in flags.locations {
|
||||
if let Some(path) = location.path_opt() {
|
||||
if path.is_file() {
|
||||
if let Some(parent) = path.parent() {
|
||||
commands.push(app.open_tab(
|
||||
Location::Path(parent.to_path_buf()),
|
||||
true,
|
||||
Some(vec![path.to_path_buf()]),
|
||||
));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
commands.push(app.open_tab(location, true, None));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue