diff --git a/exports/atom.coffee b/exports/atom.coffee index c5a7ffb63..2eb3c6e36 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -8,6 +8,7 @@ module.exports = File: require '../src/file' fs: require 'fs-plus' Git: require '../src/git' + ConfigObserver: require '../src/config-observer' Point: Point Range: Range diff --git a/src/config-observer.coffee b/src/config-observer.coffee index ca52945c5..46d3c44dd 100644 --- a/src/config-observer.coffee +++ b/src/config-observer.coffee @@ -1,4 +1,7 @@ +Mixin = require 'mixto' + module.exports = +class ConfigObserver extends Mixin observeConfig: (keyPath, args...) -> @configSubscriptions ?= {} @configSubscriptions[keyPath] = atom.config.observe(keyPath, args...) diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 6974ad9ba..2479101d7 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -15,7 +15,7 @@ ConfigObserver = require './config-observer' module.exports = class DisplayBuffer extends Model Serializable.includeInto(this) - _.extend @prototype, ConfigObserver + ConfigObserver.includeInto(this) @properties softWrap: null diff --git a/src/space-pen-extensions.coffee b/src/space-pen-extensions.coffee index c048d803a..11bcc3c1a 100644 --- a/src/space-pen-extensions.coffee +++ b/src/space-pen-extensions.coffee @@ -1,9 +1,9 @@ _ = require 'underscore-plus' spacePen = require 'space-pen' -ConfigObserver = require './config-observer' {Subscriber} = require 'emissary' +ConfigObserver = require './config-observer' -_.extend spacePen.View.prototype, ConfigObserver +ConfigObserver.includeInto(spacePen.View) Subscriber.includeInto(spacePen.View) jQuery = spacePen.jQuery