add simple replace functionality
This commit is contained in:
parent
f655d16a78
commit
5bc8d8236e
1 changed files with 6 additions and 0 deletions
|
|
@ -692,6 +692,12 @@ ace.Editor = function(renderer, doc) {
|
||||||
this.selection.moveCursorWordLeft();
|
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.find = function(needle) {
|
||||||
this.clearSelection();
|
this.clearSelection();
|
||||||
this.$search.set({needle: needle});
|
this.$search.set({needle: needle});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue