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

Common root logic is ignored #289

Open
tekumara opened this issue Jun 27, 2020 · 2 comments
Open

Common root logic is ignored #289

tekumara opened this issue Jun 27, 2020 · 2 comments
Assignees

Comments

@tekumara
Copy link

tekumara commented Jun 27, 2020

Common:
When multiple directories match all queries, and they all have a common
prefix, z will cd to the shortest matching directory, without regard to
priority. This has been in effect, if undocumented, for quite some
time, but should probably be configurable or reconsidered.

When there's a common root, z chooses the shortest matching directory as I expect:

$ cat ~/.z
/Users/tekumara/code/setup|1244.42|1593232000
/Users/tekumara/code|223.405|1593230323

$ z code -l
common:    /Users/tekumara/code
5905186    /Users/tekumara/code
37359611   /Users/tekumara/code/setup

However, the common root logic isn't applied in the following case, which gives the surprising behaviour of choosing the more frequent directory:

$ cd ~/.vscode/extensions
$ cat ~/.z
/Users/tekumara/.vscode/extensions|1|1593232307
/Users/tekumara/code/setup|1247.42|1593232301
/Users/tekumara/code|223.405|1593230323

$ z code -l
59990      /Users/tekumara/.vscode/extensions
5782900    /Users/tekumara/code
37395675   /Users/tekumara/code/setup

I was still expecting /Users/tekumara/code to win, despite the addition of the vscode directory.

@gschaffner
Copy link

Seconded. Another example is

$ cat ~/.z
/home/ganden/vc/jlab/pydux|814.861|1593380312
/home/ganden/vc|202.221|1593372880
$ z -l vc
404.442    /home/ganden/vc
3267.44    /home/ganden/vc/jlab/pydux

but I would like z vc to take me to ~/vc.

@Neno23
Copy link

Neno23 commented Jan 23, 2021

⁉️❓❔.… olympus?

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

No branches or pull requests

4 participants