Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoxide with file paths #1017

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

azaleacolburn
Copy link
Contributor

@azaleacolburn azaleacolburn commented Mar 15, 2025

Description

Allows users to use file paths to change their current directory to that file's parent directory as per #1015.

The intended behavior of z foo/bar.baz would be to change their cwd into the directory matching foo/.

This PR accomplishes this by mapping over self.keywords in Query::get_stream.

Warning

Introduces the method transformed_keywords on Query which is called every time a query command is run, and a several heap allocation for each keyword.
More importantly, it does not modify self.keywords, meaning any uses of self.keywords along the query control flow after the stream is constructed won't match up with the stream.
As far as I can tell though, there are no such usages.

@azaleacolburn azaleacolburn marked this pull request as draft March 15, 2025 04:16
@azaleacolburn azaleacolburn marked this pull request as ready for review March 15, 2025 04:17
@azaleacolburn azaleacolburn marked this pull request as draft March 16, 2025 19:48
@azaleacolburn azaleacolburn marked this pull request as ready for review March 19, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant