mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
meta-, opens user configuration file
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
Keymap = require 'keymap'
|
||||
fs = require 'fs'
|
||||
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
require 'underscore-extensions'
|
||||
@@ -14,7 +16,7 @@ class App
|
||||
@windows = []
|
||||
@setUpKeymap()
|
||||
@tabText = " "
|
||||
@userConfigurationPath = "~/.atom"
|
||||
@userConfigurationPath = require.resolve(fs.absolute("~/.atom"))
|
||||
|
||||
setUpKeymap: ->
|
||||
@keymap = new Keymap()
|
||||
|
||||
@@ -13,14 +13,18 @@ class Keymap
|
||||
@bindKeys "*",
|
||||
'meta-n': 'newWindow'
|
||||
'meta-o': 'open'
|
||||
'meta-,': 'open-user-configuration'
|
||||
|
||||
@_newWindow = => $native.newWindow()
|
||||
@_open = =>
|
||||
url = $native.openDialog()
|
||||
atom.open(url) if url
|
||||
@_openUserConfiguration = =>
|
||||
atom.open(atom.userConfigurationPath)
|
||||
|
||||
$(document).on 'newWindow', @_newWindow
|
||||
$(document).on 'open', @_open
|
||||
$(document).on 'open-user-configuration', @_openUserConfiguration
|
||||
|
||||
unbindDefaultKeys: ->
|
||||
$(document).unbind 'newWindow', @_newWindow
|
||||
|
||||
@@ -47,11 +47,10 @@ windowAdditions =
|
||||
$(@rootViewParentSelector).append @rootView
|
||||
|
||||
loadUserConfiguration: ->
|
||||
absolutePath = fs.absolute(atom.userConfigurationPath)
|
||||
try
|
||||
require absolutePath if fs.exists(absolutePath)
|
||||
require atom.userConfigurationPath if fs.exists(atom.userConfigurationPath)
|
||||
catch error
|
||||
console.error "Failed to load `#{absolutePath}`", error
|
||||
console.error "Failed to load `#{atom.userConfigurationPath}`", error
|
||||
@showConsole()
|
||||
|
||||
requireStylesheet: (path) ->
|
||||
|
||||
Reference in New Issue
Block a user