Support guide column callback function

This allows a config function to be registered
in the atom.coffee file to support different wrap
guide columns depending on the type of file being
viewed.
This commit is contained in:
Kevin Sawicki
2012-09-29 10:57:14 -07:00
parent 755f1fc273
commit 6412cde7a8
5 changed files with 54 additions and 15 deletions

View File

@@ -61,9 +61,9 @@ windowAdditions =
unless $("head style[id='#{id}']").length
$('head').append "<style id='#{id}'>#{text}</style>"
requireExtension: (name) ->
requireExtension: (name, config) ->
extensionPath = require.resolve name
extension = rootView.activateExtension require(extensionPath)
extension = rootView.activateExtension(require(extensionPath), config)
extensionKeymapPath = fs.join(fs.directory(extensionPath), "keymap.coffee")
require extensionKeymapPath if fs.exists(extensionKeymapPath)