Implement filtering hints by text and related changes
This brings several more or less breaking changes:
- Non-hint chars now filter hint markers by the text of their elements,
using an algorithm similar to the location bar (split the search term
on whitespace; all the items must occur in the search text, case
insensitively, and may overlap). The matched text is highlighted on
screen. If all remaining hints are the same, they are automatically
activated. All of this can be turned off via prefs, though.
- Since space is used to filter hint markers by element text, the
already existing `<space>` shortcut for rotating hint markers had to
be changed. It is now `<c-space>`. (`<s-space>` remains unchanged.)
- Uppercase hint chars are now allowed. This is so that people who
prefer filtering by text in the first hand can use uppercase hint
chars. If mixed case is used, `text-transform: uppercase;` is not
applied, to avoid confusion.
- Since using uppercase characters for filtering hint markers by element
text and lowercase characters for hint chars (or vice versa) is now a
thing, holding shift no longer lets you peek through the hint markers,
because that felt like the markers blinking all the time. Instead, you
now have to hold shift+control to peek through.
- Hint markers are now placed immediately to left of its element's text
if it would cover the text otherwise. This is because when filtering
hints by text, it can be quite difficult to see what to type
otherwise. This also turned out to be helpful even when only using the
hints (like before). It’s nice being able to see all the link text in
many cases.
- Hint markers now get their `z-index` assigned based on their element's
area, not their weight. It's confusing when a smaller element's hint
cover the hint of a larger element. This could be the case where there
are lots of small profile image links all with the same `href`.
Previously, all those links got `z-index` based on their combined
area. Now, their individual areas are used instead. This problem
became apparent because of the above bullet point.
- The hint marker(s) with the best hint are now highlighted in blue.
- `<enter>` now activates the highlighted marker(s). `<c-enter>` and
`<a-enter>` can be used to toggle where links open, just as when
using those modifiers with the last hint char. However, these
shortcuts were already taken, so the old ones had to be given new
shortcuts:
- "Increase count" now uses `<up>` (instead of `<enter>`).
- "Toggle complementary" now uses `<c-backspace>` (instead of
`<c-enter>`).
- All existing hints prefs were renamed from starting with `hint_` or
`hints_` to starting with `hints.`, for consistency and organization.
A few new prefs starting with `hints.` were added as well. Migrations
are written for this.
This also unveiled a problem. If a config file tries to set an old
pref and VimFx is upgraded, the config file will throw errors. This is
bad user experience, so a system for allowing old names was added.
However, that might mean that users never notice that they use an
outdated name and never update their config files. Therefore, old
names are only allowed when the config file is loaded automatically
(on startup), but _not_ when it is reloaded using `gC`. The idea is
that people use `gC` while working on their config file, which usually
involves fixing errors. Then they could just as well fix the old pref
names as well.
- The options in VimFx's settings page in the Add-ons Manager have been
slightly re-ordered to play better with the new options added, and to
promote some very important prefs to the top.
All of the above required some significant refactoring of Hints mode,
that should make it more robust.
Fixes #340. A big thanks to @doy who got this all started with #789.