From 5479c694826b3c3fcc8cae20d843918cc477264c Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 16 May 2011 17:12:31 +0500 Subject: [PATCH] fix bug from previous commit, splits is undefined --- lib/ace/edit_session.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index de1cd453..44a83ff1 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -1442,9 +1442,12 @@ var EditSession = function(text, mode) { if (this.$useWrapMode) { splits = this.$wrapData[docRow]; - if (splits && screenRow > row && splits.length) { - docColumn = splits[screenRow - row - 1] || splits[splits.length - 1]; - line = line.substring(docColumn); + if (splits) { + column = splits[screenRow - row] + if(screenRow > row && splits.length) { + docColumn = splits[screenRow - row - 1] || splits[splits.length - 1]; + line = line.substring(docColumn); + } } } @@ -1452,7 +1455,6 @@ var EditSession = function(text, mode) { // Need to do some clamping action here. if (this.$useWrapMode) { - column = splits[screenRow - row] if (docColumn >= column) { // We remove one character at the end such that the docColumn // position returned is not associated to the next row on the