Skip to content

Commit

Permalink
Fix issue of following symlink to broken file
Browse files Browse the repository at this point in the history
  • Loading branch information
pickfire committed Jun 21, 2022
1 parent c6e3a74 commit 21c2a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl FindFilePicker {
// the score, and only calculate it once during initialization
move |path| {
let suffix = if path.is_dir() { "/" } else { "" };
let metadata = fs::metadata(&*path).unwrap();
let metadata = path.symlink_metadata().unwrap();
let path = path.strip_prefix(&dir1).unwrap_or(path).to_string_lossy();
if cfg!(unix) {
let filetype = fields::filetype(&metadata);
Expand Down

0 comments on commit 21c2a16

Please sign in to comment.