mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Reload grammar on path changed in TokenizedBuffer
This commit is contained in:
parent
b19126024a
commit
4f2d935a1d
@ -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"
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user