clamp row before clamping column

This commit is contained in:
nightwing 2011-05-02 10:02:57 +05:00
commit 0ddf25b27b

View file

@ -1425,13 +1425,18 @@ var EditSession = function(text, mode) {
}
}
splits = this.$wrapData[docRow] || [];
// clamp row before clamping column, for selection on last line
var maxRow = this.getLength()-1
if(docRow > maxRow)
docRow = maxRow;
foldLine = this.getFoldLine(docRow);
line = foldLine
? this.getFoldDisplayLine(foldLine)
: this.getLine(docRow);
if (this.$useWrapMode) {
splits = this.$wrapData[docRow] || [];
docColumn = split = splits[screenRow - row - 1] || 0;
line = line.substring(split);
}