Rename Project.open to Project.buildEditSessionForPath

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-07-18 11:19:25 -07:00
parent 522149c84d
commit d36873f702
11 changed files with 51 additions and 46 deletions

View File

@@ -14,7 +14,7 @@ class EditSession
@idCounter: 1
@deserialize: (state, project) ->
session = project.open(state.buffer)
session = project.buildEditSessionForPath(state.buffer)
session.setScrollTop(state.scrollTop)
session.setScrollLeft(state.scrollLeft)
session.setCursorScreenPosition(state.cursorScreenPosition)

View File

@@ -21,6 +21,7 @@ class Project
constructor: (path) ->
@setPath(path)
@editSessions = []
@buffer = []
@setTabText(' ')
@setAutoIndent(true)
@setSoftTabs(true)
@@ -84,7 +85,7 @@ class Project
getSoftWrap: -> @softWrap
setSoftWrap: (@softWrap) ->
open: (filePath, editSessionOptions={}) ->
buildEditSessionForPath: (filePath, editSessionOptions={}) ->
@buildEditSession(@bufferForPath(filePath), editSessionOptions)
buildEditSession: (buffer, editSessionOptions) ->

View File

@@ -96,7 +96,7 @@ class RootView extends View
allowActiveEditorChange = options.allowActiveEditorChange ? false
unless editSession = @openInExistingEditor(path, allowActiveEditorChange)
editSession = @project.open(path)
editSession = @project.buildEditSessionForPath(path)
editor = new Editor({editSession})
pane = new Pane(editor)
@panes.append(pane)
@@ -120,7 +120,7 @@ class RootView extends View
editor.focus()
return editSession
editSession = @project.open(path)
editSession = @project.buildEditSessionForPath(path)
activeEditor.edit(editSession)
editSession