     # Update Title
     @emitter.emit 'did-change-title'
     # Start preview processing
-    cEditor = atom.workspace.getActiveEditor()
+    cEditor = atom.workspace.getActiveTextEditor()
     editor = @getEditor()
     # console.log('renderPreviewWithRenderer', rendererName)
     # console.log('editor', editor, cEditor)

    updateOnTabChange =
      atom.config.get 'preview.updateOnTabChange'
    if updateOnTabChange
      currEditor = atom.workspace.getActiveEditor()
      if currEditor?
        # Stop watching for events on current Editor
        @disposables.dispose()

      @emitter.on 'did-change-title', callback

  handleEvents: () ->
    currEditor = atom.workspace.getActiveTextEditor()
    if currEditor?
      @disposables.add currEditor.getBuffer().onDidStopChanging =>
        @changeHandler() if atom.config.get 'preview.liveUpdate'
