Skip to content

Commit

Permalink
feat(ad): add a trailing slash to directories in Directory buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
sminez committed Sep 17, 2024
1 parent 7069431 commit a50bc89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ impl BufferKind {
let mut raw_entries = Vec::new();
for entry in path.read_dir()? {
let p = entry?.path();
raw_entries.push(p.strip_prefix(&path).unwrap_or(&p).display().to_string());
let mut s = p.strip_prefix(&path).unwrap_or(&p).display().to_string();
if p.metadata().map(|m| m.is_dir()).unwrap_or_default() {
s.push('/');
}
raw_entries.push(s);
}
raw_entries.sort_unstable();

Expand Down

0 comments on commit a50bc89

Please sign in to comment.