mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
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:
committed by
probablycorey
parent
9fe1be7fe0
commit
beaeac4425
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user