Add transferEditSessionAtIndex to Editor

This commit is contained in:
Justin Palmer
2013-02-11 17:02:34 -08:00
parent 4502ec04d3
commit 0acd532428
2 changed files with 4 additions and 1 deletions

View File

@@ -549,6 +549,9 @@ class Editor extends View
"Cancel"
)
transferEditSessionAtIndex: (fromIndex, toIndex, toEditor) ->
toEditor.editSessions.splice(toIndex, 0, @editSessions.splice(fromIndex, 1)[0])
activateEditSessionForPath: (path) ->
for editSession, index in @editSessions
if editSession.buffer.getPath() == path

View File

@@ -89,7 +89,7 @@ class TabView extends SortableList
draggedTab.remove()
draggedTab.insertAfter(droppedNearTab)
currentDraggedTabIndex = draggedTab.index()
toEditor.editSessions.splice(currentDraggedTabIndex, 0, fromEditor.editSessions.splice(previousDraggedTabIndex, 1)[0])
fromEditor.transferEditSessionAtIndex(previousDraggedTabIndex, currentDraggedTabIndex, toEditor)
if !fromPane.find('.tab').length
fromPane.view().remove()