💉 paths into Keymap constructor

This commit is contained in:
Kevin Sawicki 2013-11-11 09:03:07 -08:00
parent 9f8a8139e0
commit 23c8db09b7
2 changed files with 6 additions and 3 deletions

View File

@ -9,6 +9,8 @@ describe "Keymap", ->
beforeEach ->
keymap = new Keymap
resourcePath: window.resourcePath
configDirPath: atom.getConfigDirPath()
fragment = $ """
<div class="command-mode">
<div class="child-node">

View File

@ -30,16 +30,17 @@ class Keymap
bindingSetsByFirstKeystroke: null
queuedKeystrokes: null
constructor: ->
constructor: ({resourcePath, @configDirPath})->
@bundledKeymapsDirPath = path.join(resourcePath, "keymaps")
@bindingSets = []
@bindingSetsByFirstKeystroke = {}
loadBundledKeymaps: ->
@loadDirectory(config.bundledKeymapsDirPath)
@loadDirectory(@bundledKeymapsDirPath)
@emit('bundled-keymaps-loaded')
loadUserKeymap: ->
userKeymapPath = CSON.resolve(path.join(config.configDirPath, 'keymap'))
userKeymapPath = CSON.resolve(path.join(@configDirPath, 'keymap'))
@load(userKeymapPath) if userKeymapPath
loadDirectory: (directoryPath) ->