fix bug from previous commit, splits is undefined

This commit is contained in:
nightwing 2011-05-16 17:12:31 +05:00
commit 5479c69482

View file

@ -1442,9 +1442,12 @@ var EditSession = function(text, mode) {
if (this.$useWrapMode) { if (this.$useWrapMode) {
splits = this.$wrapData[docRow]; splits = this.$wrapData[docRow];
if (splits && screenRow > row && splits.length) { if (splits) {
docColumn = splits[screenRow - row - 1] || splits[splits.length - 1]; column = splits[screenRow - row]
line = line.substring(docColumn); 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. // Need to do some clamping action here.
if (this.$useWrapMode) { if (this.$useWrapMode) {
column = splits[screenRow - row]
if (docColumn >= column) { if (docColumn >= column) {
// We remove one character at the end such that the docColumn // We remove one character at the end such that the docColumn
// position returned is not associated to the next row on the // position returned is not associated to the next row on the