Do not cd to path that is not a directory, fixes #87
This commit is contained in:
parent
af4828a509
commit
d15372a635
1 changed files with 21 additions and 14 deletions
|
|
@ -1233,6 +1233,10 @@ impl Tab {
|
|||
}
|
||||
if let Some(location) = cd {
|
||||
if location != self.location {
|
||||
if match &location {
|
||||
Location::Path(path) => path.is_dir(),
|
||||
Location::Trash => true,
|
||||
} {
|
||||
self.location = location.clone();
|
||||
self.items_opt = None;
|
||||
self.select_focus = None;
|
||||
|
|
@ -1249,6 +1253,9 @@ impl Tab {
|
|||
self.history.push(location.clone());
|
||||
}
|
||||
commands.push(Command::ChangeLocation(self.title(), location));
|
||||
} else {
|
||||
log::warn!("tried to cd to {:?} which is not a directory", location);
|
||||
}
|
||||
}
|
||||
}
|
||||
commands
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue