]> git.gir.st - VimFx.git/commit
Improve automatic mode switching on page load
authorSimon Lydell <simon.lydell@gmail.com>
Fri, 1 Apr 2016 14:30:08 +0000 (16:30 +0200)
committerSimon Lydell <simon.lydell@gmail.com>
Fri, 1 Apr 2016 14:44:50 +0000 (16:44 +0200)
commitdbccc940c0128a62ecdf1b1f88a5b2b1bf0ccfe7
treef7c51a05d9cdd1aa7de3c18da2425e8714b37167
parent09c8b2f531928a61e766776aabf55a8e6eff138b
Improve automatic mode switching on page load

Previously, Normal mode was _always_ entered on location change (page load)
(unless the page is blacklisted; then Ignore mode is entered instead). There
were to reasons for this: Handling the blacklist, and auto-exiting hints mode
(because hints left over from another page does not make sense in a new page).
However, this caused a few problems:

- If you used the `zF` command while a page was loading, the markers would
  disappear when the page fired the "location change" event.
- There was an ugly special case for Find mode, making sure not to enter Normal
  mode if currently in Find mode (see commit fc7e61e7c).
- Sometimes, you can enter Hints mode on a newly loaded page just before the
  page fires the "location change" event, making hints annoyingly disappear.

This commit changes two things:

- Hints mode is automatically exited (by returning to Normal mode) on the
  'pagehide' event instead.
- The current mode is only changed on location change _if needed._ That is, to
  auto-exit Ignore mode after navigating away from a blacklisted page, or
  auto-enter Ignore mode on blacklisted pages.
extension/lib/events-frame.coffee
extension/lib/vim.coffee
Imprint / Impressum