From 009967b9ba7b7a14b9773f7ba18b8d9f5c85c747 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 18 Mar 2016 07:36:54 +0000 Subject: Refactor mode initialisation for clarity. --- content_scripts/vimium_frontend.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 14fd10b7..a1461622 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -103,6 +103,10 @@ class NormalMode extends KeyHandlerMode if area == "local" and changes.normalModeKeyStateMapping?.newValue @setKeyMapping changes.normalModeKeyStateMapping.newValue + # Initialize components which normal mode depends upon. + Scroller.init() + FindModeHistory.init() + commandHandler: ({command: registryEntry, count}) -> count *= registryEntry.options.count ? 1 count = 1 if registryEntry.noRepeat @@ -128,8 +132,6 @@ installModes = -> normalMode = new NormalMode new InsertMode permanent: true new GrabBackFocus if isEnabledForUrl - Scroller.init() - FindModeHistory.init() normalMode # Return the normalMode object (for the tests). initializeOnEnabledStateKnown = Utils.makeIdempotent -> -- cgit v1.2.3