[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 IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
|
||||
|
||||
/*********** create editor ***************************/
|
||||
var container = document.getElementById("editor-container");
|
||||
|
||||
|
|
@ -83,9 +85,6 @@ env.editor.setAnimatedScroll(true);
|
|||
// add multiple cursor support to editor
|
||||
require("ace/multi_select").MultiSelect(env.editor);
|
||||
|
||||
// add incremental search
|
||||
window.iSearch = new (require("ace/incremental_search").IncrementalSearch)();
|
||||
|
||||
var consoleEl = dom.createElement("div");
|
||||
container.parentNode.appendChild(consoleEl);
|
||||
consoleEl.style.cssText = "position:fixed; bottom:1px; right:0;\
|
||||
|
|
@ -171,7 +170,7 @@ commands.addCommand({
|
|||
exec: function() {alert("Fake Save File");}
|
||||
});
|
||||
|
||||
var keybindings = {
|
||||
var keybindings = {
|
||||
ace: null, // Null = use "default" keymapping
|
||||
vim: require("ace/keyboard/vim").handler,
|
||||
emacs: "ace/keyboard/emacs",
|
||||
|
|
@ -377,7 +376,7 @@ bindDropdown("split", function(value) {
|
|||
sp.setSplits(1);
|
||||
} else {
|
||||
var newEditor = (sp.getSplits() == 1);
|
||||
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
|
||||
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
|
||||
sp.setSplits(2);
|
||||
|
||||
if (newEditor) {
|
||||
|
|
@ -393,6 +392,10 @@ bindCheckbox("elastic_tabstops", function(checked) {
|
|||
env.editor.setOption("useElasticTabstops", checked);
|
||||
});
|
||||
|
||||
bindCheckbox("isearch", function(checked) {
|
||||
env.editor.setOption("useIncrementalSearch", checked);
|
||||
});
|
||||
|
||||
|
||||
function synchroniseScrolling() {
|
||||
var s1 = env.split.$editors[0].session;
|
||||
|
|
@ -448,4 +451,3 @@ var StatusBar = require("./statusbar").StatusBar;
|
|||
new StatusBar(env.editor, cmdLine.container);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -249,6 +249,14 @@
|
|||
<input type="checkbox" id="elastic_tabstops">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >
|
||||
<label for="isearch">Incremental Search</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" id="isearch">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >
|
||||
<label for="highlight_token">Show token info</label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue