Merge branch 'ui/refactor' of github.com:ajaxorg/ace into ui/refactor
This commit is contained in:
commit
3e404b953e
1 changed files with 6 additions and 6 deletions
|
|
@ -173,18 +173,18 @@ Search.SELECTION = 2;
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
this.replace = function(input, replacement) {
|
this.replace = function(input, replacement) {
|
||||||
|
if (!this.$options.regExp)
|
||||||
|
return input == this.$options.needle ? replacement : null;
|
||||||
|
|
||||||
var re = this.$assembleRegExp();
|
var re = this.$assembleRegExp();
|
||||||
if (!re)
|
if (!re)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var match = re.exec(input);
|
var match = re.exec(input);
|
||||||
if (match && match[0].length == input.length) {
|
if (match && match[0].length == input.length) {
|
||||||
if (this.$options.regExp) {
|
return input.replace(re, replacement);
|
||||||
return input.replace(re, replacement);
|
}
|
||||||
} else {
|
else {
|
||||||
return replacement;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue