From 5505f69eb0a28a488259d2808d2f643be4ca9b4b Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 14 Feb 2011 01:00:44 +0800 Subject: [PATCH] linehighlight have wrong height on last line --- lib/ace/edit_session.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 7d8062cd..eeb9feef 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -1151,6 +1151,10 @@ var EditSession = function(text, mode) { column: column }; } + + var rowData = this.$documentToScreenRow(row, column); + var screenRow = rowData[0]; + if (row >= this.getLength()) { return { row: screenRow, @@ -1160,11 +1164,8 @@ var EditSession = function(text, mode) { var split; var wrapRowData = this.$wrapData[row]; - var screenRow, screenRowOffset; var screenColumn; - var rowData = this.$documentToScreenRow(row, column); - screenRow = rowData[0]; - screenRowOffset = rowData[1]; + var screenRowOffset = rowData[1]; str = this.getLine(row).substring( wrapRowData[screenRowOffset - 1] || 0, column); @@ -1191,4 +1192,4 @@ var EditSession = function(text, mode) { }).call(EditSession.prototype); exports.EditSession = EditSession; -}); +}); \ No newline at end of file