Use window.extension to load extensions from .atom file

This commit is contained in:
Corey Johnson
2012-07-03 12:51:30 -07:00
parent b96bd29ef5
commit 263065171d

View File

@@ -55,6 +55,14 @@ windowAdditions =
return if $("head style[path='#{fullPath}']").length
$('head').append "<style path='#{fullPath}'>#{content}</style>"
extension: (name) ->
extensionPath = require.resolve name
extension = require extensionPath
rootView.activateExtension(extension)
extensionKeymapPath = fs.join(fs.directory(extensionPath), "keymap.coffee")
require extensionKeymapPath if fs.exists(extensionKeymapPath)
reload: ->
if rootView.getModifiedBuffers().length > 0
message = "There are unsaved buffers, reload anyway?"