     panes = atom.workspace.getPanes()
     for p in panes
       activeItem = p.getActiveItem()
-      if activeItem instanceof TextEditor
+      if atom.workspace.isTextEditor(activeItem)
         if editor1 == null
           editor1 = activeItem
         else if editor2 == null

{CompositeDisposable, Emitter, TextEditor, TextBuffer} = require 'atom'
DiffViewEditor = require './build-lines'
SyncScroll = require './sync-scroll'
configSchema = require "./config-schema"


    # auto open editor panes so we have two to diff with
    if editor1 == null
      editor1 = atom.workspace.buildTextEditor()
      leftPane = atom.workspace.getActivePane()
      leftPane.addItem(editor1)
    if editor2 == null
      editor2 = atom.workspace.buildTextEditor()
      editor2.setGrammar(editor1.getGrammar())
      rightPane = atom.workspace.getActivePane().splitRight()
      rightPane.addItem(editor2)
