If file is passed on command line, show parent folder and select it

This commit is contained in:
Jeremy Soller 2025-01-22 09:06:41 -07:00
parent 3460c2c106
commit 2095d3c7f2
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -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));
}