mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Shift-triple-click expands the selection over the clicked line
This commit is contained in:
@@ -126,6 +126,9 @@ class Cursor extends View
|
||||
getCurrentWordBufferRange: ->
|
||||
new Range(@getBeginningOfCurrentWordBufferPosition(allowPrevious: false), @getEndOfCurrentWordBufferPosition(allowNext: false))
|
||||
|
||||
getCurrentLineBufferRange: ->
|
||||
@editor.rangeForBufferRow(@getBufferPosition().row)
|
||||
|
||||
moveToEndOfLine: ->
|
||||
{ row } = @getBufferPosition()
|
||||
@setBufferPosition({ row, column: @editor.buffer.lineForRow(row).length })
|
||||
|
||||
@@ -145,7 +145,10 @@ class Editor extends View
|
||||
else
|
||||
@compositeSelection.getLastSelection().selectWord()
|
||||
else if clickCount >= 3
|
||||
@compositeSelection.getLastSelection().selectLine()
|
||||
if e.shiftKey
|
||||
@compositeSelection.getLastSelection().expandOverLine()
|
||||
else
|
||||
@compositeSelection.getLastSelection().selectLine()
|
||||
|
||||
@selectOnMousemoveUntilMouseup()
|
||||
|
||||
|
||||
@@ -166,8 +166,10 @@ class Selection extends View
|
||||
@setBufferRange(@getBufferRange().union(@cursor.getCurrentWordBufferRange()))
|
||||
|
||||
selectLine: (row=@cursor.getBufferPosition().row) ->
|
||||
rowLength = @editor.buffer.lineForRow(row).length
|
||||
@setBufferRange new Range([row, 0], [row, rowLength])
|
||||
@setBufferRange(@editor.rangeForBufferRow(row))
|
||||
|
||||
expandOverLine: ->
|
||||
@setBufferRange(@getBufferRange().union(@cursor.getCurrentLineBufferRange()))
|
||||
|
||||
selectToScreenPosition: (position) ->
|
||||
@modifySelection => @cursor.setScreenPosition(position)
|
||||
|
||||
Reference in New Issue
Block a user