add simple replace functionality

This commit is contained in:
Fabian Jakobs 2010-04-28 16:11:37 +02:00
commit 5bc8d8236e

View file

@ -692,6 +692,12 @@ ace.Editor = function(renderer, doc) {
this.selection.moveCursorWordLeft();
};
this.replace = function(replacement) {
var range = this.getSelectionRange();
range.end = this.doc.replace(range, replacement);
this.selection.setSelectionRange(range);
},
this.find = function(needle) {
this.clearSelection();
this.$search.set({needle: needle});