mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Move WorkspaceView::reopenItemSync to the Workspace model
This commit is contained in:
@@ -45,7 +45,8 @@ class WorkspaceView extends View
|
||||
Delegator.includeInto(this)
|
||||
|
||||
@delegatesProperty 'fullScreen', 'destroyedItemUris', toProperty: 'model'
|
||||
@delegatesMethods 'open', 'openSync', 'openSingletonSync', toProperty: 'model'
|
||||
@delegatesMethods 'open', 'openSync', 'openSingletonSync', 'reopenItemSync',
|
||||
toProperty: 'model'
|
||||
|
||||
@version: 4
|
||||
|
||||
@@ -282,8 +283,3 @@ class WorkspaceView extends View
|
||||
@model.destroy()
|
||||
editorView.remove() for editorView in @getEditorViews()
|
||||
super
|
||||
|
||||
# Public: Reopens the last-closed item uri if it hasn't already been reopened.
|
||||
reopenItemSync: ->
|
||||
if uri = @destroyedItemUris.pop()
|
||||
@openSync(uri)
|
||||
|
||||
@@ -106,6 +106,11 @@ class Workspace extends Model
|
||||
else
|
||||
@openSync(uri, {changeFocus, initialLine, split})
|
||||
|
||||
# Public: Reopens the last-closed item uri if it hasn't already been reopened.
|
||||
reopenItemSync: ->
|
||||
if uri = @destroyedItemUris.pop()
|
||||
@openSync(uri)
|
||||
|
||||
# Private: Removes the item's uri from the list of potential items to reopen.
|
||||
itemOpened: (item) ->
|
||||
if uri = item.getUri?()
|
||||
|
||||
Reference in New Issue
Block a user