From 876d6471665f746edcd127c18ec3d004447eecec Mon Sep 17 00:00:00 2001 From: Long Nhat Nguyen Date: Sat, 25 Feb 2017 03:33:16 +0700 Subject: [PATCH] :shirt: --- spec/text-buffer-spec.coffee | 6 +++--- src/match-iterator.coffee | 8 ++++---- src/range.coffee | 2 +- src/text-buffer.coffee | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/text-buffer-spec.coffee b/spec/text-buffer-spec.coffee index 62d77e908e..ce10b3b2d7 100644 --- a/spec/text-buffer-spec.coffee +++ b/spec/text-buffer-spec.coffee @@ -2089,7 +2089,7 @@ describe "TextBuffer", -> it "calls the iterator with the first match for the given regex in the given range", -> matches = [] ranges = [] - buffer.scanInRange /cu(rr)ent/, [[4, 0], [6 ,44]], ({match, range}) -> + buffer.scanInRange /cu(rr)ent/, [[4, 0], [6, 44]], ({match, range}) -> matches.push(match) ranges.push(range) @@ -2184,7 +2184,7 @@ describe "TextBuffer", -> ranges = [] buffer.scanInRange /cu(rr)ent/g, [[4, 0], [6, 59]], ({range, stop}) -> ranges.push(range) - stop() if ranges.length == 2 + stop() if ranges.length is 2 expect(ranges.length).toBe 2 @@ -2421,7 +2421,7 @@ describe "TextBuffer", -> ranges = [] buffer.backwardsScanInRange /cu(rr)ent/g, [[4, 0], [6, 59]], ({range, stop}) -> ranges.push(range) - stop() if ranges.length == 2 + stop() if ranges.length is 2 expect(ranges.length).toBe 2 expect(ranges[0]).toEqual [[6, 34], [6, 41]] diff --git a/src/match-iterator.coffee b/src/match-iterator.coffee index f3e088698f..0e55d35695 100644 --- a/src/match-iterator.coffee +++ b/src/match-iterator.coffee @@ -4,7 +4,7 @@ Range = require './range' class SingleLineSearchCallbackArgument lineTextOffset: 0 - Object.defineProperty @::, 'range', + Object.defineProperty SearchCallbackArgument.prototype, 'range', get: -> @computedRange ?= Range( Point(@row, @lineOffset + @match.index), @@ -13,7 +13,7 @@ class SingleLineSearchCallbackArgument set: (@computedRange) -> - Object.defineProperty @::, 'lineText', + Object.defineProperty SearchCallbackArgument.prototype, 'lineText', get: -> @buffer.lineForRow(@row) constructor: (@buffer, @row, @match, @lineOffset) -> @@ -101,7 +101,7 @@ class BackwardsSingleLine class MultiLineSearchCallbackArgument lineTextOffset: 0 - Object.defineProperty @::, 'range', + Object.defineProperty SearchCallbackArgument.prototype, 'range', get: -> return @computedRange if @computedRange? @@ -116,7 +116,7 @@ class MultiLineSearchCallbackArgument set: (range) -> @computedRange = range - Object.defineProperty @::, 'lineText', + Object.defineProperty SearchCallbackArgument.prototype, 'lineText', get: -> @buffer.lineForRow(@range.start.row) constructor: (@buffer, @match, @lengthDelta) -> diff --git a/src/range.coffee b/src/range.coffee index efbdd38394..6c2ca3a606 100644 --- a/src/range.coffee +++ b/src/range.coffee @@ -242,7 +242,7 @@ class Range # # * `otherRange` A {Range} or range-compatible {Array}. coversSameRows: (other) -> - @start.row is other.start.row && @end.row is other.end.row + @start.row is other.start.row and @end.row is other.end.row # Public: Determines whether this range intersects with the argument. # diff --git a/src/text-buffer.coffee b/src/text-buffer.coffee index 7675f58eef..8f9e796f9e 100644 --- a/src/text-buffer.coffee +++ b/src/text-buffer.coffee @@ -1536,7 +1536,7 @@ class TextBuffer @previousModifiedStatus = modifiedStatus @emitter.emit 'did-change-modified', modifiedStatus - logLines: (start = 0, end = @getLastRow())-> + logLines: (start = 0, end = @getLastRow()) -> for row in [start..end] line = @lineForRow(row) console.log row, line, line.length