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); foldLine = this.getFoldLine(docRow);
line = foldLine line = foldLine
? this.getFoldDisplayLine(foldLine) ? this.getFoldDisplayLine(foldLine)
: this.getLine(docRow); : this.getLine(docRow);
if (this.$useWrapMode) { if (this.$useWrapMode) {
splits = this.$wrapData[docRow] || [];
docColumn = split = splits[screenRow - row - 1] || 0; docColumn = split = splits[screenRow - row - 1] || 0;
line = line.substring(split); line = line.substring(split);
} }