mirror of
https://github.com/atom/atom.git
synced 2026-02-15 09:05:58 -05:00
Close inactive editor sessions on alt-meta-w
This commit is contained in:
@@ -176,6 +176,7 @@ class Editor extends View
|
||||
'editor:toggle-line-comments': @toggleLineCommentsInSelection
|
||||
'editor:log-cursor-scope': @logCursorScope
|
||||
'editor:checkout-head-revision': @checkoutHead
|
||||
'editor:close-other-editors': @destroyInactiveEditSessions
|
||||
|
||||
documentation = {}
|
||||
for name, method of editorBindings
|
||||
@@ -457,6 +458,14 @@ class Editor extends View
|
||||
editSession.destroy()
|
||||
@trigger 'editor:edit-session-removed', [editSession, index]
|
||||
|
||||
destroyInactiveEditSessions: ->
|
||||
index = 0
|
||||
while session = @editSessions[index]
|
||||
if @activeEditSession is session or session.buffer.isModified()
|
||||
index++
|
||||
else
|
||||
@destroyEditSessionIndex(index)
|
||||
|
||||
loadNextEditSession: ->
|
||||
nextIndex = (@getActiveEditSessionIndex() + 1) % @editSessions.length
|
||||
@setActiveEditSessionIndex(nextIndex)
|
||||
|
||||
Reference in New Issue
Block a user