mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Shift-click creates a selection
It would be nice to handle shift-double-click and shift-triple-click as well.
This commit is contained in:
@@ -910,6 +910,16 @@ describe "Editor", ->
|
||||
expect(range.end).toEqual({row: 5, column: 27})
|
||||
expect(editor.getCursorScreenPosition()).toEqual(row: 5, column: 27)
|
||||
|
||||
describe "shift-click", ->
|
||||
it "selects from the cursor's current location to the clicked location", ->
|
||||
editor.attachToDom()
|
||||
editor.css(position: 'absolute', top: 10, left: 10)
|
||||
|
||||
editor.setCursorScreenPosition([4, 7])
|
||||
editor.lines.trigger mousedownEvent(editor: editor, point: [5, 27], shiftKey: true)
|
||||
|
||||
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 27]]
|
||||
|
||||
describe "select-to-top", ->
|
||||
it "selects text from cusor position to the top of the buffer", ->
|
||||
editor.setCursorScreenPosition [11,2]
|
||||
|
||||
@@ -135,6 +135,8 @@ class Editor extends View
|
||||
screenPosition = @screenPositionFromMouseEvent(e)
|
||||
if e.metaKey
|
||||
@addCursorAtScreenPosition(screenPosition)
|
||||
else if e.shiftKey
|
||||
@selectToScreenPosition(@screenPositionFromMouseEvent(e))
|
||||
else
|
||||
@setCursorScreenPosition(screenPosition)
|
||||
else if clickCount == 2
|
||||
|
||||
Reference in New Issue
Block a user