shift-double-click and shift-triple-click are ignored.

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-10-30 16:43:00 -07:00
parent 2bb5770a8b
commit 426c952d73
2 changed files with 10 additions and 12 deletions

View File

@@ -615,24 +615,28 @@ describe "Editor", ->
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 24]]
describe "shift-double-click", ->
it "expands the selection to include the double-clicked word", ->
it "expands the selection on the first click and ignores the second click", ->
editor.setCursorScreenPosition([4, 7])
editor.renderedLines.trigger mousedownEvent(editor: editor, point: [5, 24], shiftKey: true, originalEvent: { detail: 1 })
editor.renderedLines.trigger 'mouseup'
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 24]]
editor.renderedLines.trigger mousedownEvent(editor: editor, point: [5, 24], shiftKey: true, originalEvent: { detail: 2 })
editor.renderedLines.trigger 'mouseup'
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 27]]
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 24]]
describe "shift-triple-click", ->
it "expands the selection to include the triple-clicked line", ->
it "expands the selection on the first click and ignores the second click", ->
editor.setCursorScreenPosition([4, 7])
editor.renderedLines.trigger mousedownEvent(editor: editor, point: [5, 24], shiftKey: true, originalEvent: { detail: 1 })
editor.renderedLines.trigger 'mouseup'
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 24]]
editor.renderedLines.trigger mousedownEvent(editor: editor, point: [5, 24], shiftKey: true, originalEvent: { detail: 2 })
editor.renderedLines.trigger 'mouseup'
editor.renderedLines.trigger mousedownEvent(editor: editor, point: [5, 24], shiftKey: true, originalEvent: { detail: 3 })
editor.renderedLines.trigger 'mouseup'
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [6, 0]]
expect(editor.getSelection().getScreenRange()).toEqual [[4, 7], [5, 24]]
describe "meta-click", ->
it "places an additional cursor", ->

View File

@@ -313,15 +313,9 @@ class Editor extends View
else
@setCursorScreenPosition(screenPosition)
else if clickCount == 2
if e.shiftKey
@activeEditSession.expandLastSelectionOverWord()
else
@activeEditSession.selectWord()
@activeEditSession.selectWord() unless e.shiftKey
else if clickCount == 3
if e.shiftKey
@activeEditSession.expandLastSelectionOverLine()
else
@activeEditSession.selectLine()
@activeEditSession.selectLine() unless e.shiftKey
@selectOnMousemoveUntilMouseup()