From 22c5db73a267bfa8fb2099732aaeffdc9acc956c Mon Sep 17 00:00:00 2001 From: Yuichi Tanikawa Date: Fri, 1 Apr 2016 07:15:36 +0900 Subject: [PATCH] Fix deprecations about TextEditor See https://github.com/atom/atom/blob/v1.6.0/exports/atom.coffee#L36-L39 --- lib/split-diff.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/split-diff.coffee b/lib/split-diff.coffee index e868080..038508d 100644 --- a/lib/split-diff.coffee +++ b/lib/split-diff.coffee @@ -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" @@ -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 @@ -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)