diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 31475e317..284380b48 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -166,6 +166,9 @@ class TextEditorPresenter row = @startRow while row < @endRow line = @model.tokenizedLineForScreenRow(row) + unless line? + throw new Error("No line exists for row #{row}. Last screen row: #{@model.getLastScreenRow()}") + visibleLineIds[line.id] = true if @state.content.lines.hasOwnProperty(line.id) @updateLineState(row, line)