Merge branch 'ui/refactor' of github.com:ajaxorg/ace into ui/refactor

This commit is contained in:
Garen Torikian 2012-05-08 23:34:45 -07:00
commit 3e404b953e

View file

@ -173,18 +173,18 @@ Search.SELECTION = 2;
*
**/
this.replace = function(input, replacement) {
if (!this.$options.regExp)
return input == this.$options.needle ? replacement : null;
var re = this.$assembleRegExp();
if (!re)
return;
var match = re.exec(input);
if (match && match[0].length == input.length) {
if (this.$options.regExp) {
return input.replace(re, replacement);
} else {
return replacement;
}
} else {
return input.replace(re, replacement);
}
else {
return null;
}
};