mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
Rename Project.open to Project.buildEditSessionForPath
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user