Set selection to a string in codemirror -


i'm trying set text selection in codemirror based on predefined string, similar find without prompt (i.e. http://perso.jojaba.fr/codemirror-test/codemirror/demo/search-element.html) except not marking value, putting selection on range (which might multi line, depending on predefined string). can't seem figure out how set selection in way. idea.

well, turns out findnext() offered searchwithoutdialog.js need. it's:

instance.on("change", function (cm, change) {     // other code snipped! //     var str = "my replacement";     var token = cm.gettokenat(change.from, false);     cm.replacerange(str, { ch: token.start, line: line }, { ch: token.end, line: line });     codemirror.commands.findnext(cm, str); } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -