vimac
vimac copied to clipboard
Rotate hints z-index non-randomly
Currently Vimac rotates hints z-index randomly by:
- Remove HintViews from superview (HintViewController)
- Shuffle the HintView array
- Iterate and add the HintViews back to superview.
Ideally we would do it like Vimium:
- Group HintViews by intersecting clusters
- Move the hint at the bottom of the cluster to the top.
This way we can minimize the no. of times the user has to press SPACE to rotate.
AFAIK there is no documented method to get the z-index of an NSView. It appears in the order that you add them to the superview.
It may be helpful to sort the z-index of overlapping hints left to right. This would make the first character more likely to be visible and require fewer rotations.
As an example, I often see hints like this one from the windows close button cluster:

If it were sorted back to front and left to right it would look like this:

And I'd know which key to hit first.