mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
💉 paths into Keymap constructor
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user