Only tab complete trailing slash if path is directory

This commit is contained in:
Jeremy Soller 2026-01-13 08:31:48 -07:00 committed by Ashley Wulber
parent e5d4a0a46e
commit e5b10fbb07

View file

@ -1469,8 +1469,10 @@ impl Location {
if let Ok(canonical) = fs::canonicalize(&path) { if let Ok(canonical) = fs::canonicalize(&path) {
path = canonical; path = canonical;
} }
// Add trailing slash if location is a path // Add trailing slash if location is a directory
path.push(""); if path.is_dir() {
path.push("");
}
self.with_path(path) self.with_path(path)
} else { } else {
self.clone() self.clone()