mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Add select-to-beginning-of-line and select-to-end-of-line
This commit is contained in:
@@ -87,6 +87,14 @@ class CompositeSeleciton
|
||||
selection.selectToBottom() for selection in @getSelections()
|
||||
@mergeIntersectingSelections()
|
||||
|
||||
selectToBeginningOfLine: ->
|
||||
selection.selectToBeginningOfLine() for selection in @getSelections()
|
||||
@mergeIntersectingSelections reverse: true
|
||||
|
||||
selectToEndOfLine: ->
|
||||
selection.selectToEndOfLine() for selection in @getSelections()
|
||||
@mergeIntersectingSelections()
|
||||
|
||||
setBufferRange: (bufferRange, options) ->
|
||||
@getLastSelection().setBufferRange(bufferRange, options)
|
||||
|
||||
|
||||
@@ -106,12 +106,14 @@ class Editor extends View
|
||||
@on 'close', => @remove(); false
|
||||
|
||||
@on 'move-to-top', => @moveCursorToTop()
|
||||
@on 'select-to-top', => @selectToTop()
|
||||
@on 'move-to-bottom', => @moveCursorToBottom()
|
||||
@on 'select-to-bottom', => @selectToBottom()
|
||||
@on 'move-to-beginning-of-line', => @moveCursorToBeginningOfLine()
|
||||
@on 'move-to-end-of-line', => @moveCursorToEndOfLine()
|
||||
@on 'move-to-first-character-of-line', => @moveCursorToFirstCharacterOfLine()
|
||||
@on 'select-to-top', => @selectToTop()
|
||||
@on 'select-to-bottom', => @selectToBottom()
|
||||
@on 'select-to-end-of-line', => @selectToEndOfLine()
|
||||
@on 'select-to-beginning-of-line', => @selectToBeginningOfLine()
|
||||
|
||||
buildCursorAndSelection: ->
|
||||
@compositeSelection = new CompositeSelection(this)
|
||||
@@ -390,6 +392,8 @@ class Editor extends View
|
||||
selectDown: -> @compositeSelection.selectDown()
|
||||
selectToTop: -> @compositeSelection.selectToTop()
|
||||
selectToBottom: -> @compositeSelection.selectToBottom()
|
||||
selectToEndOfLine: -> @compositeSelection.selectToEndOfLine()
|
||||
selectToBeginningOfLine: -> @compositeSelection.selectToBeginningOfLine()
|
||||
selectToScreenPosition: (position) -> @compositeSelection.selectToScreenPosition(position)
|
||||
clearSelections: -> @compositeSelection.clearSelections()
|
||||
|
||||
|
||||
@@ -228,6 +228,14 @@ class Selection extends View
|
||||
@modifySelection =>
|
||||
@cursor.setScreenPosition(position)
|
||||
|
||||
selectToBeginningOfLine: ->
|
||||
@modifySelection =>
|
||||
@cursor.moveToBeginningOfLine()
|
||||
|
||||
selectToEndOfLine: ->
|
||||
@modifySelection =>
|
||||
@cursor.moveToEndOfLine()
|
||||
|
||||
cut: (maintainPasteboard=false) ->
|
||||
@copy(maintainPasteboard)
|
||||
@delete()
|
||||
|
||||
Reference in New Issue
Block a user