From 42521900e8248ab95bd8a986e91934d01ecae822 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Apr 2015 18:10:43 +0200 Subject: [PATCH] :memo: Improve naming --- spec/text-editor-spec.coffee | 2 +- src/selection.coffee | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index f2945977a..3be0c8b0e 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -3376,7 +3376,7 @@ describe "TextEditor", -> expect(buffer.lineForRow(0)).toBe(line2) expect(buffer.getLineCount()).toBe(count - 2) - it "deletes only the first line when it has multiple selections", -> + it "deletes a line only once when multiple selections are on the same line", -> line1 = buffer.lineForRow(1) count = buffer.getLineCount() editor.getLastCursor().moveToTop() diff --git a/src/selection.coffee b/src/selection.coffee index 971ddbdd9..c6d6933c0 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -174,6 +174,11 @@ class Selection extends Model intersectsScreenRow: (screenRow) -> @getScreenRange().intersectsRow(screenRow) + # Public: Identifies if this selection's rows intersects with another selection's rows. + # + # * `otherSelection` A {Selection} to check against. + # + # Returns a {Boolean} intersectsByRowWith: (otherSelection) -> otherScreenRange = otherSelection.getScreenRange()