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

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

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

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