Only emit the tokenized event after the first full tokenization

This commit is contained in:
probablycorey
2014-05-28 15:56:08 -07:00
parent 2c60b0463e
commit 89dc5f26ad
2 changed files with 19 additions and 1 deletions

View File

@@ -78,6 +78,7 @@ class TokenizedBuffer extends Model
@tokenizedLines = @buildPlaceholderTokenizedLinesForRows(0, @buffer.getLastRow())
@invalidRows = []
@invalidateRow(0)
@fullyTokenized = false
setVisible: (@visible) ->
@tokenizeInBackground() if @visible
@@ -127,7 +128,8 @@ class TokenizedBuffer extends Model
if @firstInvalidRow()?
@tokenizeInBackground()
else
@emit "tokenized"
@emit "tokenized" unless @fullyTokenized
@fullyTokenized = true
firstInvalidRow: ->
@invalidRows[0]