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:
Nathan Sobo
2014-10-01 10:37:27 -06:00
parent 0fafc21bc8
commit 33c1ce863e
11 changed files with 75 additions and 57 deletions

View File

@@ -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"