Meta-a selects everything

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-05-14 16:18:37 -06:00
parent 13553f79bc
commit 9079bcb103
5 changed files with 15 additions and 0 deletions

View File

@@ -127,6 +127,9 @@ class CompositeSeleciton
selectToTop: ->
@expandSelectionsBackward (selection) => selection.selectToTop()
selectAll: ->
@expandSelectionsForward (selection) => selection.selectAll()
selectToBottom: ->
@expandSelectionsForward (selection) => selection.selectToBottom()

View File

@@ -140,6 +140,7 @@ class Editor extends View
'select-to-beginning-of-line': @selectToBeginningOfLine
'select-to-end-of-word': @selectToEndOfWord
'select-to-beginning-of-word': @selectToBeginningOfWord
'select-all': @selectAll
for name, method of editorBindings
do (name, method) =>
@@ -588,6 +589,7 @@ class Editor extends View
selectDown: -> @compositeSelection.selectDown()
selectToTop: -> @compositeSelection.selectToTop()
selectToBottom: -> @compositeSelection.selectToBottom()
selectAll: -> @compositeSelection.selectAll()
selectToBeginningOfLine: -> @compositeSelection.selectToBeginningOfLine()
selectToEndOfLine: -> @compositeSelection.selectToEndOfLine()
selectToBeginningOfWord: -> @compositeSelection.selectToBeginningOfWord()

View File

@@ -16,6 +16,7 @@ window.keymap.bindKeys '.editor',
'shift-left': 'select-left'
'shift-up': 'select-up'
'shift-down': 'select-down'
'meta-a': 'select-all'
enter: 'newline'
tab: 'tab'
backspace: 'backspace'

View File

@@ -206,6 +206,9 @@ class Selection extends View
selectToBottom: ->
@modifySelection => @cursor.moveToBottom()
selectAll: ->
@setBufferRange(@editor.buffer.getRange())
selectToBeginningOfLine: ->
@modifySelection => @cursor.moveToBeginningOfLine()