Merge pull request #2386 from atom/ks-reload-grammar-from-model

Reload grammar in editor when path changes
This commit is contained in:
Kevin Sawicki
2014-05-27 13:53:26 -07:00
2 changed files with 3 additions and 2 deletions

View File

@@ -547,7 +547,6 @@ class EditorView extends View
@showBufferConflictAlert(@editor)
@subscribe @editor, "path-changed", =>
@editor.reloadGrammar()
@trigger 'editor:path-changed'
@subscribe @editor, "grammar-changed", =>

View File

@@ -31,7 +31,9 @@ class TokenizedBuffer extends Model
@on 'grammar-changed grammar-updated', => @resetTokenizedLines()
@subscribe @buffer, "changed", (e) => @handleBufferChange(e)
@subscribe @buffer, "path-changed", => @bufferPath = @buffer.getPath()
@subscribe @buffer, "path-changed", =>
@bufferPath = @buffer.getPath()
@reloadGrammar()
@subscribe @$tabLength.changes, (tabLength) =>
lastRow = @buffer.getLastRow()