mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
Rename moveEditSessionAtIndex to moveEditSessionToIndex
This commit is contained in:
@@ -549,7 +549,7 @@ class Editor extends View
|
||||
"Cancel"
|
||||
)
|
||||
|
||||
moveEditSessionAtIndex: (fromIndex, toIndex) ->
|
||||
moveEditSessionToIndex: (fromIndex, toIndex) ->
|
||||
return if fromIndex is toIndex
|
||||
editSession = @editSessions.splice(fromIndex, 1)
|
||||
@editSessions.splice(toIndex, 0, editSession[0])
|
||||
@@ -561,10 +561,7 @@ class Editor extends View
|
||||
toEditSession = fromEditSession.copy()
|
||||
@destroyEditSessionIndex(fromIndex)
|
||||
toEditor.edit(toEditSession)
|
||||
toEditor.moveEditSessionAtIndex(toEditor.getActiveEditSessionIndex(), toIndex)
|
||||
|
||||
transferEditSessionAtIndex: (fromIndex, toIndex, toEditor) ->
|
||||
toEditor.editSessions.splice(toIndex, 0, @editSessions.splice(fromIndex, 1)[0])
|
||||
toEditor.moveEditSessionToIndex(toEditor.getActiveEditSessionIndex(), toIndex)
|
||||
|
||||
activateEditSessionForPath: (path) ->
|
||||
for editSession, index in @editSessions
|
||||
|
||||
@@ -86,7 +86,7 @@ class TabView extends SortableList
|
||||
fromIndex = draggedTab.index()
|
||||
toIndex = droppedNearTab.index()
|
||||
toIndex++ if fromIndex > toIndex
|
||||
fromEditor.moveEditSessionAtIndex(fromIndex, toIndex)
|
||||
fromEditor.moveEditSessionToIndex(fromIndex, toIndex)
|
||||
else
|
||||
toPane = $(rootView.find('.pane')[toPaneIndex])
|
||||
toEditor = toPane.find('.editor').view()
|
||||
|
||||
@@ -150,11 +150,11 @@ describe "TabView", ->
|
||||
expect(tabs.find('.tab:eq(0) .file-name').text()).toBe "sample.js"
|
||||
expect(tabs.find('.tab:eq(1) .file-name').text()).toBe "sample.txt"
|
||||
|
||||
editor.moveEditSessionAtIndex(0, 1)
|
||||
editor.moveEditSessionToIndex(0, 1)
|
||||
expect(tabs.find('.tab:eq(0) .file-name').text()).toBe "sample.txt"
|
||||
expect(tabs.find('.tab:eq(1) .file-name').text()).toBe "sample.js"
|
||||
|
||||
editor.moveEditSessionAtIndex(1, 0)
|
||||
editor.moveEditSessionToIndex(1, 0)
|
||||
expect(tabs.find('.tab:eq(0) .file-name').text()).toBe "sample.js"
|
||||
expect(tabs.find('.tab:eq(1) .file-name').text()).toBe "sample.txt"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user