Silently fail to 'enter' regular files

This commit is contained in:
Dugan Chen 2023-07-16 19:08:19 -07:00
parent 2f78691333
commit 5626422ba4

View File

@ -1035,7 +1035,11 @@ impl App {
fn enter(self) -> Result<Self> {
if let Some(path) = self.focused_node().map(|n| n.absolute_path.clone()) {
self.change_directory(&path, true)
if PathBuf::from(&path).absolutize()?.to_path_buf().is_dir() {
self.change_directory(&path, true)
} else {
Ok(self)
}
} else {
Ok(self)
}