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

Odd behavior #12

Closed
bbatsov opened this issue May 8, 2015 · 3 comments
Closed

Odd behavior #12

bbatsov opened this issue May 8, 2015 · 3 comments

Comments

@bbatsov
Copy link
Contributor

bbatsov commented May 8, 2015

What's the supposed behavior when looking for something? Should you get all possible single letter triggers before they start becoming multi-letter?

See this screenshot to understand what I mean.

@abo-abo
Copy link
Owner

abo-abo commented May 8, 2015

The algorithm works in the following way:

  • priority 1: minimize the max tree height.
  • priority 2: maximize the amount of leafs at lower height.

In your case, the max tree height is 2. And the amount of leafs on the lower height is 1 (a). If (s) were also on height 1, then there would be to space to fit the rest of the candidates => the resulting max tree height would be 3. So the algorithm works correctly here (unless it just cuts off at fa like in screenshot).

You can play around with avy-subdiv to see how it works:

(avy-subdiv 100 6)
;; =>
;; (6 6 6 10 36 36)

In this case, there are 100 candidates, and 6 decision keys. The first three branches contain 6 candidates, which means their leafs are on level 2. The next three branches have their leafs on level 3, with the fourth branch left with some free space.

@bbatsov
Copy link
Contributor Author

bbatsov commented May 8, 2015

I see. Not sure many people would understand the behaviour, but it makes sense. Maybe you should document it with more examples in the README?

@abo-abo
Copy link
Owner

abo-abo commented May 8, 2015

Added a wiki page for this.

@abo-abo abo-abo closed this as completed May 8, 2015
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