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