mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Pluralize Project API
This changes all APIs concerning paths and repositories on the project to be plural, preparing us to switch to multi-folder projects. It doesn’t make any changes to actually support multiple folders. Instead we just wrap the previous return values in singleton arrays. * constructor ‘path’ params -> ‘paths’ * getRootDirectory -> getDirectories * getPath -> getPaths * setPath -> setPaths * getRepo -> getRepositories
This commit is contained in:
@@ -133,8 +133,8 @@ class TextEditor extends Model
|
||||
subscribeToBuffer: ->
|
||||
@buffer.retain()
|
||||
@subscribe @buffer.onDidChangePath =>
|
||||
unless atom.project.getPath()?
|
||||
atom.project.setPath(path.dirname(@getPath()))
|
||||
unless atom.project.getPaths()[0]?
|
||||
atom.project.setPaths([path.dirname(@getPath())])
|
||||
@emit "title-changed"
|
||||
@emitter.emit 'did-change-title', @getTitle()
|
||||
@emit "path-changed"
|
||||
|
||||
Reference in New Issue
Block a user