mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
meta-{ goes to previous buffer
This commit is contained in:
@@ -85,6 +85,7 @@ class Editor extends View
|
||||
@on 'split-down', => @splitDown()
|
||||
@on 'close', => @remove(); false
|
||||
@on 'show-next-buffer', => @loadNextEditorState()
|
||||
@on 'show-previous-buffer', => @loadPreviousEditorState()
|
||||
|
||||
@on 'move-to-top', => @moveCursorToTop()
|
||||
@on 'move-to-bottom', => @moveCursorToBottom()
|
||||
@@ -251,6 +252,12 @@ class Editor extends View
|
||||
nextIndex = (index + 1) % @editorStates.length
|
||||
@setEditorState(@editorStates[nextIndex])
|
||||
|
||||
loadPreviousEditorState: ->
|
||||
index = @indexOfEditorState(@getEditorState())
|
||||
if index?
|
||||
previousIndex = if --index >= 0 then index else @editorStates.length - 1
|
||||
@setEditorState(@editorStates[previousIndex])
|
||||
|
||||
setEditorState: (editorState={}) ->
|
||||
buffer = editorState.buffer ?= new Buffer
|
||||
@setEditorStateForBuffer(buffer, editorState)
|
||||
|
||||
@@ -31,4 +31,5 @@ window.keymap.bindKeys '.editor',
|
||||
'alt-meta-down': 'split-down'
|
||||
'meta-[': 'outdent-selected-rows'
|
||||
'meta-]': 'indent-selected-rows'
|
||||
'meta-{': 'show-previous-buffer'
|
||||
'meta-}': 'show-next-buffer'
|
||||
Reference in New Issue
Block a user