mirror of
https://github.com/nushell/nushell.git
synced 2025-05-12 22:14:26 +02:00
# Description Closes #14794. This PR enables the strict exact match behavior requested in #13204 and #14794 for any path containing a slash (#13302 implemented this for paths ending in slashes). If any of the components along the way *don't* exactly match a directory, then the next components will use the old Fish-like completion behavior rather than the strict behavior. This change only affects those using prefix matching. Fuzzy matching remains unaffected. # User-Facing Changes Suppose you have the following directory structure: ``` - foo - bar - xyzzy - barbaz - xyzzy - foobar - bar - xyzzy - barbaz - xyzzy ``` - If you type `cd foo<TAB>`, you will be suggested `[foo, foobar]` - This is because `foo` is the last component of the path, so the strict behavior isn't activated - Similarly, `foo/bar` will show you `[foo/bar, foo/barbaz]` - If you type `foo/bar/x`, you will be suggested `[foo/bar/xyzzy]` - This is because `foo` and `bar` both exactly matched a directory - If you type `foo/b/x`, you will be suggested `[foo/bar/xyzzy, foo/barbaz/xyzzy]` - This is because `foo` matches a directory exactly, so `foobar/*` won't be suggested, but `b` doesn't exactly match a directory, so both `bar` and `barbaz` are suggested - If you type `f/b/x`, you will be suggested all four of the `xyzzy` files above - If you type `f/bar/x`, you will be suggested all four of the `xyzzy` files above - Since `f` doesn't exactly match a directory, every component after it won't use the strict matching behavior (even though `bar` exactly matches a directory) # Tests + Formatting # After Submitting This is a pretty minor change but should be mentioned somewhere in the release notes in case it surprises someone. --------- Co-authored-by: 132ikl <132@ikl.sh> |
||
---|---|---|
.. | ||
commands | ||
completions | ||
main.rs |