]> git.gir.st - VimFx.git/commit
Fix missing hint markers when re-entering Hints mode quickly
authorSimon Lydell <simon.lydell@gmail.com>
Mon, 29 Aug 2016 20:11:41 +0000 (22:11 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Mon, 29 Aug 2016 20:21:40 +0000 (22:21 +0200)
commit0d630e97b7c31995abbe07e4a3cae41bf219c551
tree7698513e614726a057cf08538b92a48f2c23fbcd
parenta75894b02534bdd3882f3e911ca75a64f3828348
Fix missing hint markers when re-entering Hints mode quickly

1. Enter Hints mode.
2. Press `<escape>` to exit it.
3. Press `f` to re-enter Hints mode within `hints_timeout` milliseconds.

This used to result in re-entering Hints mode as expected, but with no
hint markers on screen because of a timeout from the last Hints mode
session that removed the hints container. Removing the hints container
is done by ID for robustness, so it doesn't help that the hints
container actually is a new DOM element at that time.

This commit fixes the above problem, and makes the logic more robust.

In `onLeave` for Hints mode, it makes sense to always try to remove the
Hints container, so that it may not be accidentally be left on screen.
However, it does not make sense to do so after a timeout, which was
previously the case. Now, it is done _immediately_ instead.

The only case where he timeout is wanted, is when a hint marker just has
been matched. This commit also adds a check in that timeout callback that
Hints mode hasn't been re-entered before removing the hints container.
extension/lib/modes.coffee
Imprint / Impressum