feat(z): WIP - Give zoxide z
suggestions for path token as well as cwd
#2301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assistance Required - Can't figure out why CloudWatch CLI won't display what I'm returning. See "Known Issues".
What
This PR is effectively a complete rewrite of the autocomplete logic for zoxide's
z
command.In #2300, I made it so that the autocomplete included folders in the cwd. This PR takes it one step further, by also showing folders in the path token (i.e.
z ~/Documents/
will give autocomplete for folders in~/Documents/
, e.g.~/Documents/my-folder
).Known Issues
For some reason the paths I'm returning when there's a path token aren't being displayed by CloudWatch CLI, despite the format being the same as when there's not a path token. See images (taken from the devtools as per
cw debug devtools autocomplete
):With a path token:
Result:
The array I'm returning:
Without a path token:
Result:
The array I'm returning: