[incremental search] emacs uses isearch by default

This commit is contained in:
Robert Krahn 2013-03-16 23:51:33 -07:00
commit 5cc2c50ebb
4 changed files with 10 additions and 6 deletions

View file

@ -392,10 +392,14 @@ bindCheckbox("elastic_tabstops", function(checked) {
env.editor.setOption("useElasticTabstops", checked); env.editor.setOption("useElasticTabstops", checked);
}); });
bindCheckbox("isearch", function(checked) { var iSearchCheckbox = bindCheckbox("isearch", function(checked) {
env.editor.setOption("useIncrementalSearch", checked); env.editor.setOption("useIncrementalSearch", checked);
}); });
env.editor.addEventListener('incrementalSearchSettingChanged', function(event) {
iSearchCheckbox.checked = event.isEnabled;
});
function synchroniseScrolling() { function synchroniseScrolling() {
var s1 = env.split.$editors[0].session; var s1 = env.split.$editors[0].session;

View file

@ -171,6 +171,7 @@ exports.bindCheckbox = function(id, callback, noInit) {
}; };
el.onclick = onCheck; el.onclick = onCheck;
noInit || onCheck(); noInit || onCheck();
return el;
}; };
exports.bindDropdown = function(id, callback, noInit) { exports.bindDropdown = function(id, callback, noInit) {
@ -235,4 +236,3 @@ function dropdown(values) {
}); });

View file

@ -246,6 +246,7 @@ require("./config").defineOptions(Editor.prototype, "editor", {
handler.setupIncrementalSearch(this, val); handler.setupIncrementalSearch(this, val);
} }
}); });
this._emit('incrementalSearchSettingChanged', {isEnabled: val});
} }
} }
}); });

View file

@ -108,10 +108,9 @@ exports.handler.attach = function(editor) {
editor.commands.addCommands(commands); editor.commands.addCommands(commands);
exports.handler.platform = editor.commands.platform; exports.handler.platform = editor.commands.platform;
editor.$emacsModeHandler = this; editor.$emacsModeHandler = this;
var hasISearch = editor.getOption('useIncrementalSearch'); require('../incremental_search');
if (hasISearch != this.usesIncrementalSearch) { editor.setOption('useIncrementalSearch', true);
this.setupIncrementalSearch(editor, hasISearch); this.setupIncrementalSearch(editor, true);
};
}; };
exports.handler.detach = function(editor) { exports.handler.detach = function(editor) {