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

"Accidental" directories should not be counted as visited #428

Closed
lefth opened this issue Jul 23, 2022 · 1 comment
Closed

"Accidental" directories should not be counted as visited #428

lefth opened this issue Jul 23, 2022 · 1 comment

Comments

@lefth
Copy link

lefth commented Jul 23, 2022

The directory frequency should not be incremented if the user leaves the directory right away and probably did not intend to go there. This sequence should not give the first directory a higher priority, because it's obvious that it was not the intended destination:

$ z ff
# goes to ~/repo/MyProject/.git/objects/ff
$z ffm
# goes to ~/repo/ffmpeg which is what was intended all along

The algorithm I suggest for removing the increment from accidentally incremented directories is:

  • Was $OLDPWD incremented within the previous minute?
  • Was this shell's previous search also a match for the new target?
  • If the above are true, the previous search was probably meant for this target rather than $OLDPWD and $OLDPWD should be decremented.
@ajeetdsouza
Copy link
Owner

This seems like overkill, and would require changes in the DB format - so I'd say this is out of scope (at least for now).

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

2 participants