[incremental search] cleanup && fixing module dependencies
This commit is contained in:
parent
5cc2c50ebb
commit
e5fc2ea853
2 changed files with 24 additions and 22 deletions
|
|
@ -210,30 +210,32 @@ function patchHighlightMarkerStyling(options) {
|
|||
|
||||
|
||||
// support for default keyboard handler
|
||||
var CommandManager = require("./commands/command_manager").CommandManager;
|
||||
(function() {
|
||||
this.setupIncrementalSearch = function(editor, val) {
|
||||
if (this.usesIncrementalSearch == val) return;
|
||||
this.usesIncrementalSearch = val;
|
||||
var iSearchCommands = iSearchCommandModule.iSearchStartCommands,
|
||||
method = val ? 'addCommands' : 'removeCommands';
|
||||
this[method](iSearchCommands);
|
||||
};
|
||||
}).call(CommandManager.prototype);
|
||||
require(["./commands/command_manager"], function(cmdMgr) {
|
||||
(function() {
|
||||
this.setupIncrementalSearch = function(editor, val) {
|
||||
if (this.usesIncrementalSearch == val) return;
|
||||
this.usesIncrementalSearch = val;
|
||||
var iSearchCommands = iSearchCommandModule.iSearchStartCommands,
|
||||
method = val ? 'addCommands' : 'removeCommands';
|
||||
this[method](iSearchCommands);
|
||||
};
|
||||
}).call(cmdMgr.CommandManager.prototype);
|
||||
});
|
||||
|
||||
// support for emacskeyboard handler
|
||||
var emacs = require("./keyboard/emacs");
|
||||
emacs.handler.setupIncrementalSearch = function(editor, val) {
|
||||
if (this.usesIncrementalSearch == val) return;
|
||||
this.usesIncrementalSearch = val;
|
||||
if (val) {
|
||||
this.bindKey('C-s', 'iSearch');
|
||||
this.bindKey('C-r', 'iSearchBackwards');
|
||||
} else {
|
||||
this.bindKey('C-s', "findnext");
|
||||
this.bindKey('C-r', "findprevious");
|
||||
require(["./keyboard/emacs"], function(emacs) {
|
||||
emacs.handler.setupIncrementalSearch = function(editor, val) {
|
||||
if (this.usesIncrementalSearch == val) return;
|
||||
this.usesIncrementalSearch = val;
|
||||
if (val) {
|
||||
this.bindKey('C-s', 'iSearch');
|
||||
this.bindKey('C-r', 'iSearchBackwards');
|
||||
} else {
|
||||
this.bindKey('C-s', "findnext");
|
||||
this.bindKey('C-r', "findprevious");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// incremental search config option
|
||||
var Editor = require("./editor").Editor;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ var testNames = [
|
|||
"ace/editor_navigation_test",
|
||||
"ace/editor_text_edit_test",
|
||||
"ace/ext/static_highlight_test",
|
||||
"ace/incremental_search_test",
|
||||
"ace/keyboard/emacs_test",
|
||||
"ace/keyboard/keybinding_test",
|
||||
"ace/layer/text_test",
|
||||
|
|
@ -45,7 +46,6 @@ var testNames = [
|
|||
"ace/range_test",
|
||||
"ace/range_list_test",
|
||||
"ace/search_test",
|
||||
"ace/incremental_search_test",
|
||||
"ace/selection_test",
|
||||
"ace/token_iterator_test",
|
||||
"ace/virtual_renderer_test"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue