Revert "Revert "Merge pull request #1844 from atom/cj-move-functionality-to-workspace""

This reverts commit 87d008c337.
This commit is contained in:
probablycorey
2014-04-08 10:52:19 -07:00
parent d07eea405f
commit 63a80a4d4d
5 changed files with 78 additions and 82 deletions

View File

@@ -182,7 +182,7 @@ class Editor extends Model
@subscribe @$scrollTop, (scrollTop) => @emit 'scroll-top-changed', scrollTop
@subscribe @$scrollLeft, (scrollLeft) => @emit 'scroll-left-changed', scrollLeft
atom.project.addEditor(this) if registerEditor
atom.workspace.addEditor(this) if registerEditor
serializeParams: ->
id: @id
@@ -225,7 +225,7 @@ class Editor extends Model
@buffer.release()
@displayBuffer.destroy()
@languageMode.destroy()
atom.project?.removeEditor(this)
atom.workspace?.removeEditor(this)
# Create an {Editor} with its initial state based on this object
copy: ->
@@ -237,7 +237,7 @@ class Editor extends Model
newEditor.setScrollLeft(@getScrollLeft())
for marker in @findMarkers(editorId: @id)
marker.copy(editorId: newEditor.id, preserveFolds: true)
atom.project.addEditor(newEditor)
atom.workspace.addEditor(newEditor)
newEditor
# Public: Get the title the editor's title for display in other parts of the