mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 00:52:29 +03:00
💉 paths into Keymap constructor
This commit is contained in:
parent
9f8a8139e0
commit
23c8db09b7
@ -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) ->
|
||||
|
Loading…
Reference in New Issue
Block a user