diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index f6187f02d..76e84c933 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -2012,27 +2012,3 @@ describe "Editor", -> eventHandler.reset() editor.buffer.setPath("new.txt") expect(eventHandler).toHaveBeenCalled() - - describe "editorBounds()", -> - beforeEach -> - editor.attachToDom() - setEditorWidthInChars(editor, 10) - setEditorHeightInChars(editor, 10) - - it "returns correct bounds based on scroll position", -> - expect(editor.bounds()).toEqual [[0,0], [10, 10]] - editor.scroller.scrollTop(editor.lineHeight * 1) - editor.scroller.scrollLeft(editor.charWidth * 1) - expect(editor.bounds()).toEqual [[1,1], [11, 11]] - - describe "screenPositionInBounds(screenPosition)", -> - beforeEach -> - editor.attachToDom() - setEditorWidthInChars(editor, 20) - setEditorHeightInChars(editor, 10) - - it "returns true if position is in bounds", -> - expect(editor.screenPositionInBounds([0,0])).toBeTruthy() - expect(editor.screenPositionInBounds([10,20])).toBeTruthy() - expect(editor.screenPositionInBounds([10,21])).toBeFalsy() - expect(editor.screenPositionInBounds([11,21])).toBeFalsy() diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 270e7b08b..8b1892196 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -162,23 +162,6 @@ class Editor extends View rootView: -> @parents('#root-view').view() - bounds: -> - rows = @scroller.height() / @lineHeight - columns = @scroller.width() / @charWidth - - start = new Point(@scroller.scrollTop() / @lineHeight, @scroller.scrollLeft() / @charWidth) - end = new Point(start.row + rows, start.column + columns) - - new Range(start, end) - - screenPositionInBounds: (screenPosition) -> - screenPosition = Point.fromObject(screenPosition) - bounds = @bounds() - bounds.start.row <= screenPosition.row and - bounds.start.column <= screenPosition.column and - bounds.end.row >= screenPosition.row and - bounds.end.column >= screenPosition.column - selectOnMousemoveUntilMouseup: -> moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e)) @on 'mousemove', moveHandler