 
   componentWillMount: ->
     @props.editor.manageScrollPosition = true
+
+    @disposables = new CompositeDisposable
+
     @observeConfig()
     @setScrollSensitivity(atom.config.get('editor.scrollSensitivity'))
 

        # clipboard.writeText is a sync ipc call on Linux and that
        # will slow down selections.
        ipc.send('write-text-to-selection-clipboard', selectedText)
    @subscribe editor.onDidChangeSelectionRange ->
      clearTimeout(timeoutId)
      timeoutId = setTimeout(writeSelectedTextToSelectionClipboard)

  observeConfig: ->
    @subscribe atom.config.onDidChange 'editor.fontSize', @sampleFontStyling
    @subscribe atom.config.onDidChange 'editor.fontFamily', @sampleFontStyling
    @subscribe atom.config.onDidChange 'editor.lineHeight', @sampleFontStyling

  onGrammarChanged: ->
    {editor} = @props

    @scopedConfigSubscriptions?.dispose()
    @scopedConfigSubscriptions = subscriptions = new CompositeDisposable

    scopeDescriptor = editor.getRootScopeDescriptor()

    subscriptions.add atom.config.observe 'editor.scrollSensitivity', scope: scopeDescriptor, @setScrollSensitivity

  focused: ->
    if @isMounted()

      @requestUpdate()

  onCursorAdded: (cursor) ->
    @disposables.add cursor.onDidChangePosition @onCursorMoved

  onCursorMoved: ->
    @cursorMoved = true
