mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Create custom jQuery event for shift select on gutter
This commit is contained in:
@@ -1992,13 +1992,17 @@ describe "Editor", ->
|
||||
expect(editor.getText()).toBe(originalPathText)
|
||||
|
||||
describe "when clicking a gutter line", ->
|
||||
it "moves the cursor to the start of the selected line", ->
|
||||
beforeEach ->
|
||||
rootView.attachToDom()
|
||||
|
||||
it "moves the cursor to the start of the selected line", ->
|
||||
expect(editor.getCursorScreenPosition()).toEqual [0,0]
|
||||
editor.gutter.find(".line-number:eq(1)").trigger 'click'
|
||||
expect(editor.getCursorScreenPosition()).toEqual [1,0]
|
||||
|
||||
it "selects to the start of the selected line when shift is pressed", ->
|
||||
expect(editor.getSelection().getScreenRange()).toEqual [0,0], [0,0]
|
||||
editor.gutter.find(".line-number:eq(1)").trigger 'click', {shiftKey: true}
|
||||
expect(editor.getSelection().getScreenRange()).toEqual [0,0], [1,0]
|
||||
expect(editor.getSelection().getScreenRange()).toEqual [[0,0], [0,0]]
|
||||
event = $.Event("click")
|
||||
event.shiftKey = true
|
||||
editor.gutter.find(".line-number:eq(1)").trigger event
|
||||
expect(editor.getSelection().getScreenRange()).toEqual [[0,0], [1,0]]
|
||||
|
||||
Reference in New Issue
Block a user