Skip to content

Commit ec88b04

Browse files
committed
Closes #141 by using new languageMode APIs
1 parent fde3847 commit ec88b04

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.5.3 - 2018-03-02
2+
* Fixed syntax highlighting not working for automatically opened editors #141
3+
14
## 1.5.2 - 2017-12-29
25
* Fixed infinite scroll loop when performing a next/prev diff command #136
36

lib/split-diff.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ module.exports = SplitDiff =
386386
if editor2 == null
387387
editor2 = atom.workspace.buildTextEditor({autoHeight: false})
388388
@wasEditor2Created = true
389-
editor2.setGrammar(editor1.getGrammar())
390389
rightPaneIndex = panes.indexOf(atom.workspace.paneForItem(editor1)) + 1
391390
if panes[rightPaneIndex]
392391
# add second editor to existing pane to the right of first editor
@@ -395,6 +394,7 @@ module.exports = SplitDiff =
395394
else
396395
# no existing pane so split right
397396
atom.workspace.paneForItem(editor1).splitRight({items: [editor2]})
397+
editor2.getBuffer().setLanguageMode(editor1.getBuffer().getLanguageMode())
398398

399399
return Promise.resolve({editor1: editor1, editor2: editor2})
400400

0 commit comments

Comments
 (0)