From 111b956f93d274bfc237c9c808ec0e60f150c80a Mon Sep 17 00:00:00 2001 From: Adam Boesch Date: Tue, 16 Sep 2014 21:18:59 -0500 Subject: [PATCH] Fix cursor not being able to move within the last line of text. --- src/display-buffer.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 37e8acfd4..71271d880 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -661,9 +661,8 @@ class DisplayBuffer extends Model targetTop = pixelPosition.top targetLeft = pixelPosition.left defaultCharWidth = @defaultCharWidth - rawRowCount = targetTop / @getLineHeightInPixels() - isLastRow = rawRowCount > @getLastRow() - row = Math.floor(rawRowCount) + row = Math.floor(targetTop / @getLineHeightInPixels()) + isLastRow = row > @getLastRow() row = Math.min(row, @getLastRow()) row = Math.max(0, row)