Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
👕
Browse files Browse the repository at this point in the history
  • Loading branch information
torn4dom4n committed Feb 24, 2017
1 parent d532cdd commit 876d647
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions spec/text-buffer-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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]]
Expand Down
8 changes: 4 additions & 4 deletions src/match-iterator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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) ->
Expand Down Expand Up @@ -101,7 +101,7 @@ class BackwardsSingleLine
class MultiLineSearchCallbackArgument
lineTextOffset: 0

Object.defineProperty @::, 'range',
Object.defineProperty SearchCallbackArgument.prototype, 'range',
get: ->
return @computedRange if @computedRange?

Expand All @@ -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) ->
Expand Down
2 changes: 1 addition & 1 deletion src/range.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
2 changes: 1 addition & 1 deletion src/text-buffer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 876d647

Please sign in to comment.