From 07a2a6710d2dce5593a1d7644e31856d85635778 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 23 May 2014 16:15:24 -0700 Subject: [PATCH] Reload grammar in editor when path changes --- src/editor-view.coffee | 1 - src/editor.coffee | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 1d4d6a475..18f8a2427 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -547,7 +547,6 @@ class EditorView extends View @showBufferConflictAlert(@editor) @subscribe @editor, "path-changed", => - @editor.reloadGrammar() @trigger 'editor:path-changed' @subscribe @editor, "grammar-changed", => diff --git a/src/editor.coffee b/src/editor.coffee index 161a4455c..96bb72307 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -200,6 +200,8 @@ class Editor extends Model atom.project.setPath(path.dirname(@getPath())) @emit "title-changed" @emit "path-changed" + @reloadGrammar() + @subscribe @buffer, "contents-modified", => @emit "contents-modified" @subscribe @buffer, "contents-conflicted", => @emit "contents-conflicted" @subscribe @buffer, "modified-status-changed", => @emit "modified-status-changed"