fix #1580 Mouse SelectByLines does not select ending char
This commit is contained in:
parent
5f6dd8c89f
commit
8cb5b1f0e9
2 changed files with 2 additions and 4 deletions
|
|
@ -171,14 +171,12 @@ var Autocomplete = function() {
|
||||||
var lower = needle.toLowerCase();
|
var lower = needle.toLowerCase();
|
||||||
loop: for (var i = 0, item; item = items[i]; i++) {
|
loop: for (var i = 0, item; item = items[i]; i++) {
|
||||||
var caption = item.value || item.caption;
|
var caption = item.value || item.caption;
|
||||||
|
if (!caption) continue;
|
||||||
var lastIndex = -1;
|
var lastIndex = -1;
|
||||||
var matchMask = 0;
|
var matchMask = 0;
|
||||||
var penalty = 0;
|
var penalty = 0;
|
||||||
var index, distance;
|
var index, distance;
|
||||||
// caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf
|
// 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++) {
|
for (var j = 0; j < needle.length; j++) {
|
||||||
// TODO add penalty on case mismatch
|
// TODO add penalty on case mismatch
|
||||||
var i1 = caption.indexOf(lower[j], lastIndex + 1);
|
var i1 = caption.indexOf(lower[j], lastIndex + 1);
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,7 @@ var Selection = function(session) {
|
||||||
} else {
|
} else {
|
||||||
rowEnd = rowStart;
|
rowEnd = rowStart;
|
||||||
}
|
}
|
||||||
if (excludeLastChar)
|
if (excludeLastChar === true)
|
||||||
return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);
|
return new Range(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);
|
||||||
else
|
else
|
||||||
return new Range(rowStart, 0, rowEnd + 1, 0);
|
return new Range(rowStart, 0, rowEnd + 1, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue