]> git.gir.st - VimFx.git/commit
Speed up and refactor Hints mode
authorSimon Lydell <simon.lydell@gmail.com>
Sun, 8 May 2016 18:56:54 +0000 (20:56 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Sun, 15 May 2016 11:23:27 +0000 (13:23 +0200)
commit5a855c02c2d24570064fe4088e1ab6a21dd0b891
treef81f8e46a87e69bb386c0e94b7fe0dbe6d4af1f9
parent195caa6b409e681426937736587a003d38ff5d71
Speed up and refactor Hints mode

This makes most hints show up on screen up to twice as fast as before.
The rest of the hints show up at the same speed as before. Hints
generation has been optimized for the common case, by looking for
markable elements in two passes (if needed and possible). First, we look
for common and fast-to-find elements (such as links); then we look for
everything else. Addresses #409.

Code has been pulled out of marker.coffee, modes.coffee and
hints.coffee, and put into the new marker-container.coffee. hints.coffee
was then renamed to markable-elements.coffee (because all it does now is
finding markable elements).

The concept of tagging elements as "semantic" has been removed. The idea
was to give "unsemantic" elements worse hints (so they wouldn't trump
links, for example). Now, such elements are usually found in the second
pass instead, which gives about the same effect.

`<c-enter>` in Hints mode no longer replaces all hints with new ones for
_all_ elements on screen. Instead, it replaces the hints with hints for
all _unmarked_ elements on screen. Pressing `<c-enter>` again toggles
back to the original hints.

There is a breaking API change for `vimfx.setHintMatcher(hintMatcher)`.
`hintMatcher` no longer receives and returns an object (of the shape
`{type, semantic}`), but instead simply receives and returns the `type`
of the element.
28 files changed:
documentation/api.md
documentation/commands.md
documentation/options.md
extension/lib/commands-frame.coffee
extension/lib/commands.coffee
extension/lib/defaults.coffee
extension/lib/help.coffee
extension/lib/main.coffee
extension/lib/markable-elements.coffee [moved from extension/lib/hints.coffee with 68% similarity]
extension/lib/marker-container.coffee [new file with mode: 0644]
extension/lib/marker.coffee
extension/lib/modes.coffee
extension/lib/parse-prefs.coffee
extension/lib/viewport.coffee
extension/locale/de/vimfx.properties
extension/locale/en-US/vimfx.properties
extension/locale/es/vimfx.properties
extension/locale/fr/vimfx.properties
extension/locale/id/vimfx.properties
extension/locale/it/vimfx.properties
extension/locale/ja/vimfx.properties
extension/locale/nl/vimfx.properties
extension/locale/pt-BR/vimfx.properties
extension/locale/ru/vimfx.properties
extension/locale/sv-SE/vimfx.properties
extension/locale/zh-CN/vimfx.properties
extension/locale/zh-TW/vimfx.properties
extension/test/test-api.coffee
Imprint / Impressum