mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Always try to unwatch current user keymap
This commit is contained in:
@@ -126,16 +126,17 @@ class Keymap
|
||||
CSON.resolve(path.join(@configDirPath, 'keymap'))
|
||||
|
||||
unwatchUserKeymap: ->
|
||||
return unless keymapPath = @userKeymapPath()
|
||||
@remove(keymapPath)
|
||||
keymapPath = @userKeymapPath()
|
||||
@userKeymapFile?.off()
|
||||
@remove(keymapPath) if keymapPath
|
||||
|
||||
loadUserKeymap: ->
|
||||
return unless keymapPath = @userKeymapPath()
|
||||
keymapPath = @userKeymapPath()
|
||||
@unwatchUserKeymap()
|
||||
@load(keymapPath)
|
||||
@userKeymapFile = new File(keymapPath)
|
||||
@userKeymapFile.on 'contents-changed', => @loadUserKeymap()
|
||||
if keymapPath
|
||||
@load(keymapPath)
|
||||
@userKeymapFile = new File(keymapPath)
|
||||
@userKeymapFile.on 'contents-changed', => @loadUserKeymap()
|
||||
|
||||
loadDirectory: (directoryPath) ->
|
||||
@load(filePath) for filePath in fs.listSync(directoryPath, ['.cson', '.json'])
|
||||
|
||||
Reference in New Issue
Block a user