:lipstick

This commit is contained in:
Corey Johnson
2012-04-02 14:26:43 -07:00
parent a75441b809
commit 7dae03de0d
2 changed files with 29 additions and 42 deletions

View File

@@ -64,45 +64,43 @@ class CompositeSeleciton
selectToScreenPosition: (position) ->
@getLastSelection().selectToScreenPosition(position)
selectRight: ->
selection.selectRight() for selection in @getSelections()
moveSelections: (fn) ->
fn(selection) for selection in @getSelections()
@mergeIntersectingSelections()
reverseMoveSelections: (fn) ->
fn(selection) for selection in @getSelections()
@mergeIntersectingSelections(reverse: true)
selectRight: ->
@moveSelections (selection) => selection.selectRight()
selectLeft: ->
selection.selectLeft() for selection in @getSelections()
@mergeIntersectingSelections reverse: true
@reverseMoveSelections (selection) => selection.selectLeft()
selectUp: ->
selection.selectUp() for selection in @getSelections()
@mergeIntersectingSelections reverse: true
@reverseMoveSelections (selection) => selection.selectUp()
selectDown: ->
selection.selectDown() for selection in @getSelections()
@mergeIntersectingSelections()
@moveSelections (selection) => selection.selectDown()
selectToTop: ->
selection.selectToTop() for selection in @getSelections()
@mergeIntersectingSelections reverse: true
@reverseMoveSelections (selection) => selection.selectToTop()
selectToBottom: ->
selection.selectToBottom() for selection in @getSelections()
@mergeIntersectingSelections()
@moveSelections (selection) => selection.selectToBottom()
selectToBeginningOfLine: ->
selection.selectToBeginningOfLine() for selection in @getSelections()
@mergeIntersectingSelections reverse: true
@reverseMoveSelections (selection) => selection.selectToBeginningOfLine()
selectToEndOfLine: ->
selection.selectToEndOfLine() for selection in @getSelections()
@mergeIntersectingSelections()
@moveSelections (selection) => selection.selectToEndOfLine()
selectToBeginningOfWord: ->
selection.selectToBeginningOfWord() for selection in @getSelections()
@mergeIntersectingSelections reverse: true
@reverseMoveSelections (selection) => selection.selectToBeginningOfWord()
selectToEndOfWord: ->
selection.selectToEndOfWord() for selection in @getSelections()
@mergeIntersectingSelections()
@moveSelections (selection) => selection.selectToEndOfWord()
setBufferRange: (bufferRange, options) ->
@getLastSelection().setBufferRange(bufferRange, options)

View File

@@ -98,8 +98,7 @@ class Selection extends View
[start, end] = [end, start] if reverse
@cursor.setScreenPosition(start)
@modifySelection =>
@cursor.setScreenPosition(end)
@modifySelection => @cursor.setScreenPosition(end)
getBufferRange: ->
@editor.bufferRangeForScreenRange(@getScreenRange())
@@ -209,44 +208,34 @@ class Selection extends View
@setBufferRange new Range([row, 0], [row, rowLength])
selectRight: ->
@modifySelection =>
@cursor.moveRight()
@modifySelection => @cursor.moveRight()
selectLeft: ->
@modifySelection =>
@cursor.moveLeft()
@modifySelection => @cursor.moveLeft()
selectUp: ->
@modifySelection =>
@cursor.moveUp()
@modifySelection => @cursor.moveUp()
selectDown: ->
@modifySelection =>
@cursor.moveDown()
@modifySelection => @cursor.moveDown()
selectToTop: ->
@modifySelection =>
@cursor.moveToTop()
@modifySelection => @cursor.moveToTop()
selectToBottom: ->
@modifySelection =>
@cursor.moveToBottom()
@modifySelection => @cursor.moveToBottom()
selectToBeginningOfLine: ->
@modifySelection =>
@cursor.moveToBeginningOfLine()
@modifySelection => @cursor.moveToBeginningOfLine()
selectToEndOfLine: ->
@modifySelection =>
@cursor.moveToEndOfLine()
@modifySelection => @cursor.moveToEndOfLine()
selectToBeginningOfWord: ->
@modifySelection =>
@cursor.moveToBeginningOfWord()
@modifySelection => @cursor.moveToBeginningOfWord()
selectToEndOfWord: ->
@modifySelection =>
@cursor.moveToEndOfWord()
@modifySelection => @cursor.moveToEndOfWord()
cut: (maintainPasteboard=false) ->
@copy(maintainPasteboard)