From 8aaac870dcb94696cbc8174a1d92a311e07cefa3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 11 May 2015 09:45:55 +0200 Subject: [PATCH] Ensure we have at least one line per tile This will prevent, for example, a mini editor (which has no `@height` by default) from not showing characters. --- src/text-editor-presenter.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 12044bff0..0111c7a8a 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -306,6 +306,7 @@ class TextEditorPresenter return unless @startRow? and @endRow? and @lineHeight? linesPerTile = Math.floor(@height / @lineHeight / @tileCount) + linesPerTile = Math.max(1, linesPerTile) startIndex = Math.max( 0, Math.floor(@startRow / linesPerTile) - @tileOverdrawMargin