[incremental search] extending kitchen sink to use isearch
This commit is contained in:
parent
4d09567bc0
commit
8a62ad8be0
2 changed files with 16 additions and 6 deletions
|
|
@ -64,6 +64,8 @@ var bindDropdown = util.bindDropdown;
|
||||||
|
|
||||||
var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
|
var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
|
||||||
|
|
||||||
|
var IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
|
||||||
|
|
||||||
/*********** create editor ***************************/
|
/*********** create editor ***************************/
|
||||||
var container = document.getElementById("editor-container");
|
var container = document.getElementById("editor-container");
|
||||||
|
|
||||||
|
|
@ -83,9 +85,6 @@ env.editor.setAnimatedScroll(true);
|
||||||
// add multiple cursor support to editor
|
// add multiple cursor support to editor
|
||||||
require("ace/multi_select").MultiSelect(env.editor);
|
require("ace/multi_select").MultiSelect(env.editor);
|
||||||
|
|
||||||
// add incremental search
|
|
||||||
window.iSearch = new (require("ace/incremental_search").IncrementalSearch)();
|
|
||||||
|
|
||||||
var consoleEl = dom.createElement("div");
|
var consoleEl = dom.createElement("div");
|
||||||
container.parentNode.appendChild(consoleEl);
|
container.parentNode.appendChild(consoleEl);
|
||||||
consoleEl.style.cssText = "position:fixed; bottom:1px; right:0;\
|
consoleEl.style.cssText = "position:fixed; bottom:1px; right:0;\
|
||||||
|
|
@ -393,6 +392,10 @@ bindCheckbox("elastic_tabstops", function(checked) {
|
||||||
env.editor.setOption("useElasticTabstops", checked);
|
env.editor.setOption("useElasticTabstops", checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
bindCheckbox("isearch", function(checked) {
|
||||||
|
env.editor.setOption("useIncrementalSearch", checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function synchroniseScrolling() {
|
function synchroniseScrolling() {
|
||||||
var s1 = env.split.$editors[0].session;
|
var s1 = env.split.$editors[0].session;
|
||||||
|
|
@ -448,4 +451,3 @@ var StatusBar = require("./statusbar").StatusBar;
|
||||||
new StatusBar(env.editor, cmdLine.container);
|
new StatusBar(env.editor, cmdLine.container);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,14 @@
|
||||||
<input type="checkbox" id="elastic_tabstops">
|
<input type="checkbox" id="elastic_tabstops">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
|
<label for="isearch">Incremental Search</label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" id="isearch">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<label for="highlight_token">Show token info</label>
|
<label for="highlight_token">Show token info</label>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue