Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/split-diff.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{CompositeDisposable, Emitter, TextEditor, TextBuffer} = require 'atom'
{CompositeDisposable, Emitter, TextBuffer} = require 'atom'
DiffViewEditor = require './build-lines'
SyncScroll = require './sync-scroll'
configSchema = require "./config-schema"
Expand Down Expand Up @@ -45,7 +45,7 @@ module.exports = SplitDiff =
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
Expand All @@ -54,11 +54,11 @@ module.exports = SplitDiff =

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