mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Make Pane handle split commands instead of Editor
This commit is contained in:
committed by
probablycorey
parent
fee835f899
commit
7d147dd2ce
@@ -172,10 +172,6 @@ class Editor extends View
|
||||
'editor:fold-current-row': @foldCurrentRow
|
||||
'editor:unfold-current-row': @unfoldCurrentRow
|
||||
'editor:fold-selection': @foldSelection
|
||||
'editor:split-left': @splitLeft
|
||||
'editor:split-right': @splitRight
|
||||
'editor:split-up': @splitUp
|
||||
'editor:split-down': @splitDown
|
||||
'editor:show-next-buffer': @loadNextEditSession
|
||||
'editor:show-buffer-1': => @setActiveEditSessionIndex(0) if @editSessions[0]
|
||||
'editor:show-buffer-2': => @setActiveEditSessionIndex(1) if @editSessions[1]
|
||||
@@ -789,20 +785,17 @@ class Editor extends View
|
||||
@updateLayerDimensions()
|
||||
@requestDisplayUpdate()
|
||||
|
||||
newSplitEditor: (editSession) ->
|
||||
new Editor { editSession: editSession ? @activeEditSession.copy() }
|
||||
|
||||
splitLeft: (editSession) ->
|
||||
@pane()?.splitLeft(@newSplitEditor(editSession)).currentItem
|
||||
@pane()?.splitLeft()
|
||||
|
||||
splitRight: (editSession) ->
|
||||
@pane()?.splitRight(@newSplitEditor(editSession)).currentItem
|
||||
@pane()?.splitRight()
|
||||
|
||||
splitUp: (editSession) ->
|
||||
@pane()?.splitUp(@newSplitEditor(editSession)).currentItem
|
||||
@pane()?.splitUp()
|
||||
|
||||
splitDown: (editSession) ->
|
||||
@pane()?.splitDown(@newSplitEditor(editSession)).currentItem
|
||||
@pane()?.splitDown()
|
||||
|
||||
pane: ->
|
||||
@closest('.pane').view()
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
'ctrl-tab': 'window:focus-next-pane'
|
||||
'ctrl-meta-f': 'window:toggle-full-screen'
|
||||
|
||||
'.pane':
|
||||
'ctrl-|': 'pane:split-right'
|
||||
'ctrl-w v': 'pane:split-right'
|
||||
'ctrl--': 'pane:split-down'
|
||||
'ctrl-w s': 'pane:split-down'
|
||||
|
||||
'.tool-panel':
|
||||
'meta-escape': 'tool-panel:unfocus'
|
||||
'escape': 'core:close'
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
'ctrl-{': 'editor:fold-all'
|
||||
'ctrl-}': 'editor:unfold-all'
|
||||
'alt-meta-ctrl-f': 'editor:fold-selection'
|
||||
'ctrl-|': 'editor:split-right'
|
||||
'ctrl-w v': 'editor:split-right'
|
||||
'ctrl--': 'editor:split-down'
|
||||
'ctrl-w s': 'editor:split-down'
|
||||
'shift-tab': 'editor:outdent-selected-rows'
|
||||
'meta-[': 'editor:outdent-selected-rows'
|
||||
'meta-]': 'editor:indent-selected-rows'
|
||||
|
||||
@@ -22,6 +22,10 @@ class Pane extends View
|
||||
|
||||
@command 'pane:show-next-item', @showNextItem
|
||||
@command 'pane:show-previous-item', @showPreviousItem
|
||||
@command 'pane:split-left', => @splitLeft()
|
||||
@command 'pane:split-right', => @splitRight()
|
||||
@command 'pane:split-up', => @splitUp()
|
||||
@command 'pane:split-down', => @splitDown()
|
||||
@on 'focus', => @viewForCurrentItem().focus()
|
||||
|
||||
getItems: ->
|
||||
|
||||
Reference in New Issue
Block a user