mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add RootView.proto.focusNextPane
This commit is contained in:
@@ -140,6 +140,15 @@ class RootView extends View
|
||||
else
|
||||
@panes.find('.editor:first').view()
|
||||
|
||||
focusNextPane: ->
|
||||
panes = @panes.find('.pane')
|
||||
currentIndex = panes.toArray().indexOf(@getFocusedPane()[0])
|
||||
nextIndex = (currentIndex + 1) % panes.length
|
||||
panes.eq(nextIndex).view().wrappedView.focus()
|
||||
|
||||
getFocusedPane: ->
|
||||
@panes.find('.pane:has(:focus)')
|
||||
|
||||
setRootPane: (pane) ->
|
||||
@panes.empty()
|
||||
@panes.append(pane)
|
||||
|
||||
Reference in New Issue
Block a user