forked from extern/nushell
make cd recornize symblic link (#5454)
This commit is contained in:
parent
768ff47d28
commit
e14e60dd2c
@ -4,6 +4,7 @@ use nu_protocol::{
|
|||||||
levenshtein_distance, Span,
|
levenshtein_distance, Span,
|
||||||
};
|
};
|
||||||
use reedline::Suggestion;
|
use reedline::Suggestion;
|
||||||
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ pub fn directory_completion(
|
|||||||
return result
|
return result
|
||||||
.filter_map(|entry| {
|
.filter_map(|entry| {
|
||||||
entry.ok().and_then(|entry| {
|
entry.ok().and_then(|entry| {
|
||||||
if let Ok(metadata) = entry.metadata() {
|
if let Ok(metadata) = fs::metadata(entry.path()) {
|
||||||
if metadata.is_dir() {
|
if metadata.is_dir() {
|
||||||
let mut file_name = entry.file_name().to_string_lossy().into_owned();
|
let mut file_name = entry.file_name().to_string_lossy().into_owned();
|
||||||
if matches(&partial, &file_name, match_algorithm) {
|
if matches(&partial, &file_name, match_algorithm) {
|
||||||
|
Loading…
Reference in New Issue
Block a user