diff --git a/src/project.coffee b/src/project.coffee index 93a3ed496..70d5b93a2 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -391,6 +391,10 @@ class Project extends Model subscribeToBuffer: (buffer) -> buffer.onDidDestroy => @removeBuffer(buffer) + buffer.onDidChangePath => + console.log('did change path! ' + buffer.getPath()) + unless @getPaths().length > 0 + @setPaths([path.dirname(buffer.getPath())]) buffer.onWillThrowWatchError ({error, handle}) => handle() @notificationManager.addWarning """ diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 85e285f8a..4ed926848 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -166,8 +166,6 @@ class TextEditor extends Model subscribeToBuffer: -> @buffer.retain() @disposables.add @buffer.onDidChangePath => - unless @project.getPaths().length > 0 - @project.setPaths([path.dirname(@getPath())]) @emitter.emit 'did-change-title', @getTitle() @emitter.emit 'did-change-path', @getPath() @disposables.add @buffer.onDidChangeEncoding =>