Open .atom files from browser process

This allows a new window to be created if there is no currently
focused window.
This commit is contained in:
Kevin Sawicki
2014-01-20 09:46:49 -08:00
parent 4ac3be7ab5
commit 71c48ec07f
4 changed files with 31 additions and 20 deletions

View File

@@ -27,6 +27,14 @@ class Workspace extends Model
constructor: ->
super
@subscribe @paneContainer, 'item-destroyed', @onPaneItemDestroyed
atom.project.registerOpener (filePath) =>
switch filePath
when 'atom://.atom/stylesheet'
@open(atom.themes.getUserStylesheetPath())
when 'atom://.atom/keymap'
@open(atom.keymap.getUserKeymapPath())
when 'atom://.atom/config'
@open(atom.config.getUserConfigPath())
# Private: Called by the Serializable mixin during deserialization
deserializeParams: (params) ->
@@ -38,18 +46,6 @@ class Workspace extends Model
paneContainer: @paneContainer.serialize()
fullScreen: atom.isFullScreen()
# Private: Open ~/.atom/user.less or ~/.atom/user.css
openUserStylesheet: ->
@open(atom.themes.getUserStylesheetPath())
# Private: Open ~/.atom/keymap.cson or ~/.atom/keymap.json
openUserKeymap: ->
@open(atom.keymap.getUserKeymapPath())
# Private: Open ~/.atom/config.cson or ~/.atom/config.json
openUserConfig: ->
@open(atom.config.getUserConfigPath())
# Public: Asynchronously opens a given a filepath in Atom.
#
# * filePath: A file path