diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index d0f5b010a..3ddc505fa 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -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", -> diff --git a/src/app/editor.coffee b/src/app/editor.coffee index b9cfd5b43..c03e4fabe 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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()