Move Keymap init above MenuManager init

This commit is contained in:
Matt Colyer
2013-10-04 14:37:53 -07:00
parent 0b3a00056f
commit 1deba49722
2 changed files with 5 additions and 6 deletions

View File

@@ -36,6 +36,8 @@ class Atom
ContextMenuManager = require './context-menu-manager'
MenuManager = require './menu-manager'
@config = new Config()
@keymap = new Keymap()
@packages = new PackageManager()
#TODO Remove once packages have been updated to not touch atom.packageStates directly
@@ -43,12 +45,10 @@ class Atom
@__defineSetter__ 'packageStates', (packageStates) => @packages.packageStates = packageStates
@subscribe @packages, 'loaded', => @watchThemes()
@config = new Config()
@themes = new ThemeManager()
@contextMenu = new ContextMenuManager(@getLoadSettings().devMode)
@menu = new MenuManager()
@pasteboard = new Pasteboard()
@keymap = new Keymap()
@syntax = deserialize(@getWindowState('syntax')) ? new Syntax()
getCurrentWindow: ->

View File

@@ -30,7 +30,7 @@ class MenuManager
# Public: Refreshes the currently visible menu.
update: ->
@sendToBrowserProcess()
@sendToBrowserProcess(@template, atom.keymap.keystrokesByCommandForSelector('body'))
# Private
loadCoreItems: ->
@@ -48,7 +48,6 @@ class MenuManager
menu.push(item)
# Private
sendToBrowserProcess: ->
return unless atom.keymap
ipc.sendChannel 'update-application-menu', @template, atom.keymap.keystrokesByCommandForSelector('body')
sendToBrowserProcess: (template, keystrokesByCommand) ->
ipc.sendChannel 'update-application-menu', template, keystrokesByCommand