fix #1580 Mouse SelectByLines does not select ending char

This commit is contained in:
nightwing 2013-08-30 15:25:38 +04:00
commit 8cb5b1f0e9
2 changed files with 2 additions and 4 deletions

View file

@ -171,14 +171,12 @@ var Autocomplete = function() {
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
var caption = item.value || item.caption;
if (!caption) continue;
var lastIndex = -1;
var matchMask = 0;
var penalty = 0;
var index, distance;
// caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf
if (!caption) {
continue loop
}
for (var j = 0; j < needle.length; j++) {
// TODO add penalty on case mismatch
var i1 = caption.indexOf(lower[j], lastIndex + 1);

View file

@ -421,7 +421,7 @@ var Selection = function(session) {
} else {
rowEnd = rowStart;
}
if (excludeLastChar)
if (excludeLastChar === true)
return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);
else
return new Range(rowStart, 0, rowEnd + 1, 0);