From d9a238c6736715ae3fd68bf53661e7c3da664745 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 7 Sep 2013 22:56:50 +0200 Subject: [PATCH] Fix: Dropped out of insert mode on location change For example, it would be nice to usually be in insert mode in gmail, and only occasionally leave it. However, as soon as you for example went from the inbox to an e-mail, the location changed, which caused normal mode to be entered. Only when in hints mode we need to do that (issue #101). --- extension/packages/events.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extension/packages/events.coffee b/extension/packages/events.coffee index 4cbc849..2cb6048 100644 --- a/extension/packages/events.coffee +++ b/extension/packages/events.coffee @@ -105,12 +105,15 @@ windowsListeners = # This listener works on individual tabs within Chrome Window tabsListener = - # Listenfor location changes, disable the extension on blacklisted urls, and make sure that we - # start out in normal mode + # Listenfor location changes and disable the extension on blacklisted urls onLocationChange: (browser, webProgress, request, location) -> return unless vim = vimBucket.get(browser.contentWindow) - vim.enterNormalMode() + # If the location changes when in hints mode (for example because the reload button has been + # clicked), we're going to end up in hints mode without any markers. So switch back to normal + # mode in that case. + if vim.mode == 'hints' + vim.enterNormalMode() blacklisted = utils.isBlacklisted(location.spec, getPref('black_list')) vim.blacklisted = blacklisted -- 2.39.3