mirror of
https://github.com/atom/atom.git
synced 2026-02-07 21:25:05 -05:00
When Buffer's path changes, stop listening for events on former path
This commit is contained in:
@@ -35,6 +35,7 @@ class Buffer
|
||||
null
|
||||
|
||||
setPath: (path) ->
|
||||
@file?.off()
|
||||
@file = new File(path)
|
||||
@file.on "contents-change", =>
|
||||
@setText(fs.read(@file.getPath())) unless @isModified()
|
||||
|
||||
Reference in New Issue
Block a user