       @emitter.on 'did-change-title', callback
 
   handleEvents: () ->
-    currEditor = atom.workspace.getActiveEditor()
+    currEditor = atom.workspace.getActiveTextEditor()
     if currEditor?
       @disposables.add currEditor.getBuffer().onDidStopChanging =>
         @changeHandler() if atom.config.get 'preview.liveUpdate'

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

    # 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)
