diff options
| author | Stephen Blott | 2016-03-18 07:36:54 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-18 07:36:54 +0000 |
| commit | 009967b9ba7b7a14b9773f7ba18b8d9f5c85c747 (patch) | |
| tree | cba8107265f172b3a16f1ec5325e7c9fe418ba65 /content_scripts | |
| parent | a5ff084fba22c43ed170308e41a31b62455e52a1 (diff) | |
| download | vimium-009967b9ba7b7a14b9773f7ba18b8d9f5c85c747.tar.bz2 | |
Refactor mode initialisation for clarity.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
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 -> |
