mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 11:33:23 +02:00
Only do exact match on trailing slash
This commit is contained in:
@ -91,8 +91,12 @@ fn complete_rec(
|
|||||||
want_directory,
|
want_directory,
|
||||||
isdir,
|
isdir,
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
completions.push(built);
|
||||||
|
}
|
||||||
|
|
||||||
// For https://github.com/nushell/nushell/issues/13204
|
// For https://github.com/nushell/nushell/issues/13204
|
||||||
if options.match_algorithm == MatchAlgorithm::Prefix {
|
if isdir && options.match_algorithm == MatchAlgorithm::Prefix {
|
||||||
let exact_match = if options.case_sensitive {
|
let exact_match = if options.case_sensitive {
|
||||||
entry_name.eq(base)
|
entry_name.eq(base)
|
||||||
} else {
|
} else {
|
||||||
@ -102,9 +106,6 @@ fn complete_rec(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
completions.push(built);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
completions.push(built);
|
completions.push(built);
|
||||||
|
@ -1310,14 +1310,6 @@ fn exact_match() {
|
|||||||
&vec![file(dir.join("partial").join("hello.txt"))],
|
&vec![file(dir.join("partial").join("hello.txt"))],
|
||||||
&suggestions,
|
&suggestions,
|
||||||
);
|
);
|
||||||
|
|
||||||
let target_dir = format!("open {}", file(dir.join("pArTiAL").join("hello")));
|
|
||||||
let suggestions = completer.complete(&target_dir, target_dir.len());
|
|
||||||
|
|
||||||
match_suggestions(
|
|
||||||
&vec![file(dir.join("partial").join("hello.txt"))],
|
|
||||||
&suggestions,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[ignore = "was reverted, still needs fixing"]
|
#[ignore = "was reverted, still needs fixing"]
|
||||||
|
Reference in New Issue
Block a user