RootView.open takes an 'allowActiveEditorChange' option

When the 'allowActiveEditorChange' option is true, RootView will try to activate an existing edit session for the given path on *any* editor, and switch focus there. This will be used by the fuzzy-finder for the meta-b option, which should open the chosen buffer on the editor that contains it, even if it isn't currently active.
This commit is contained in:
Nathan Sobo
2012-06-29 09:48:16 -06:00
parent db212fc077
commit 22515e7ba0
4 changed files with 128 additions and 12 deletions

View File

@@ -389,6 +389,13 @@ class Editor extends View
@renderWhenAttached()
activateEditSessionForPath: (path) ->
for editSession, index in @editSessions
if editSession.buffer.getPath() == path
@setActiveEditSessionIndex(index)
return true
false
getOpenBufferPaths: ->
editSession.buffer.path for editSession in @editSessions when editSession.buffer.path?