Rename buildEditSessionForPath to buildEditSession

Since this is the more external method, having a shorter name
is more convenient. The former `buildEditSession` method took a
Buffer, and is now called `buildEditSessionForBuffer`.
This commit is contained in:
Nathan Sobo
2013-02-16 15:00:29 -07:00
committed by probablycorey
parent 9fe1be7fe0
commit beaeac4425
15 changed files with 73 additions and 73 deletions

View File

@@ -16,10 +16,10 @@ class EditSession
@deserialize: (state, project) ->
if fs.exists(state.buffer)
session = project.buildEditSessionForPath(state.buffer)
session = project.buildEditSession(state.buffer)
else
console.warn "Could not build edit session for path '#{state.buffer}' because that file no longer exists" if state.buffer
session = project.buildEditSessionForPath(null)
session = project.buildEditSession(null)
session.setScrollTop(state.scrollTop)
session.setScrollLeft(state.scrollLeft)
session.setCursorScreenPosition(state.cursorScreenPosition)

View File

@@ -95,10 +95,10 @@ class Project
getSoftWrap: -> @softWrap
setSoftWrap: (@softWrap) ->
buildEditSessionForPath: (filePath, editSessionOptions={}) ->
@buildEditSession(@bufferForPath(filePath), editSessionOptions)
buildEditSession: (filePath, editSessionOptions={}) ->
@buildEditSessionForBuffer(@bufferForPath(filePath), editSessionOptions)
buildEditSession: (buffer, editSessionOptions) ->
buildEditSessionForBuffer: (buffer, editSessionOptions) ->
options = _.extend(@defaultEditSessionOptions(), editSessionOptions)
options.project = this
options.buffer = buffer

View File

@@ -95,7 +95,7 @@ class RootView extends View
allowActiveEditorChange = options.allowActiveEditorChange ? false
unless editSession = @openInExistingEditor(path, allowActiveEditorChange, changeFocus)
editSession = project.buildEditSessionForPath(path)
editSession = project.buildEditSession(path)
editor = new Editor({editSession})
pane = new Pane(editor)
@panes.append(pane)
@@ -121,7 +121,7 @@ class RootView extends View
@makeEditorActive(editor, changeFocus)
return editSession
editSession = project.buildEditSessionForPath(path)
editSession = project.buildEditSession(path)
activeEditor.edit(editSession)
editSession