This commit is contained in:
Nathan Sobo 2012-11-23 10:46:26 -07:00
parent 7dc1490dee
commit f466a2eede
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ Buffer = require 'buffer'
Range = require 'range'
_ = require 'underscore'
fdescribe "TokenizedBuffer", ->
describe "TokenizedBuffer", ->
[editSession, tokenizedBuffer, buffer, changeHandler] = []
beforeEach ->

View File

@ -65,7 +65,7 @@ class TokenizedBuffer
tokenizeNextChunk: ->
rowsRemaining = @chunkSize
while @invalidRows.length and rowsRemaining > 0
while @firstInvalidRow()? and rowsRemaining > 0
invalidRow = @invalidRows.shift()
lastRow = @getLastRow()
continue if invalidRow > lastRow
@ -86,7 +86,7 @@ class TokenizedBuffer
@invalidateRow(row + 1) unless filledRegion
@trigger "change", { start: invalidRow, end: row, delta: 0 }
@tokenizeInBackground()
@tokenizeInBackground() if @firstInvalidRow()?
firstInvalidRow: ->
@invalidRows[0]