Reload grammar on path changed in TokenizedBuffer

This commit is contained in:
Kevin Sawicki 2014-05-27 08:55:40 -07:00
parent b19126024a
commit 4f2d935a1d
2 changed files with 3 additions and 2 deletions

View File

@ -196,7 +196,6 @@ class Editor extends Model
subscribeToBuffer: ->
@buffer.retain()
@subscribe @buffer, "path-changed", =>
@reloadGrammar()
unless atom.project.getPath()?
atom.project.setPath(path.dirname(@getPath()))
@emit "title-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()