mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-14 04:29:04 +03:00
Require user init script path after user keymaps
Previously the user init script path was required before the packages and user keymaps were loaded which could override config and keymap settings set by the user init script path.
This commit is contained in:
parent
86f39f8a1a
commit
969327e822
@ -179,3 +179,10 @@ _.extend atom,
|
||||
|
||||
getUpdateStatus: (callback) ->
|
||||
@sendMessageToBrowserProcess('getUpdateStatus', [], callback)
|
||||
|
||||
requireUserInitScript: ->
|
||||
userInitScriptPath = fs.join(config.configDirPath, "user.coffee")
|
||||
try
|
||||
require userInitScriptPath if fs.isFile(userInitScriptPath)
|
||||
catch error
|
||||
console.error "Failed to load `#{userInitScriptPath}`", error.stack, error
|
||||
|
@ -3,7 +3,6 @@ _ = require 'underscore'
|
||||
EventEmitter = require 'event-emitter'
|
||||
|
||||
configDirPath = fs.absolute("~/.atom")
|
||||
userInitScriptPath = fs.join(configDirPath, "user.coffee")
|
||||
bundledPackagesDirPath = fs.join(resourcePath, "src/packages")
|
||||
bundledThemesDirPath = fs.join(resourcePath, "themes")
|
||||
vendoredPackagesDirPath = fs.join(resourcePath, "vendor/packages")
|
||||
@ -53,7 +52,6 @@ class Config
|
||||
load: ->
|
||||
@initializeConfigDirectory()
|
||||
@loadUserConfig()
|
||||
@requireUserInitScript()
|
||||
|
||||
loadUserConfig: ->
|
||||
if fs.exists(@configFilePath)
|
||||
@ -100,10 +98,4 @@ class Config
|
||||
save: ->
|
||||
fs.writeObject(@configFilePath, @settings)
|
||||
|
||||
requireUserInitScript: ->
|
||||
try
|
||||
require userInitScriptPath if fs.exists(userInitScriptPath)
|
||||
catch error
|
||||
console.error "Failed to load `#{userInitScriptPath}`", error.stack, error
|
||||
|
||||
_.extend Config.prototype, EventEmitter
|
||||
|
@ -49,6 +49,7 @@ window.startup = ->
|
||||
atom.loadThemes()
|
||||
atom.loadPackages()
|
||||
keymap.loadUserKeymaps()
|
||||
atom.requireUserInitScript()
|
||||
$(window).on 'beforeunload', -> shutdown(); false
|
||||
$(window).focus()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user