mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
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:
@@ -97,10 +97,10 @@ class RootView extends View
|
||||
when 'PaneColumn' then PaneColumn.deserialize(viewState, this)
|
||||
when 'Editor' then Editor.deserialize(viewState, this)
|
||||
|
||||
activateExtension: (extension) ->
|
||||
activateExtension: (extension, config) ->
|
||||
throw new Error("Trying to activate an extension with no name") unless extension.name?
|
||||
@extensions[extension.name] = extension
|
||||
extension.activate(this, @extensionStates[extension.name])
|
||||
extension.activate(this, @extensionStates[extension.name], config)
|
||||
|
||||
deactivateExtension: (extension) ->
|
||||
extension.deactivate?()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user