зеркало из https://github.com/mozilla/gecko-dev.git
Bug 937539 - Cmd+Alt+F opens find/replace in the Debugger's editor. r=anton
This commit is contained in:
Родитель
88c57a2c39
Коммит
f8de794cf3
|
@ -189,11 +189,12 @@ let DebuggerView = {
|
|||
dumpn("Initializing the DebuggerView editor");
|
||||
|
||||
let extraKeys = {};
|
||||
let searchKey = document.getElementById("tokenSearchKey").getAttribute("key");
|
||||
extraKeys[Editor.accel(searchKey)] = (cm) => {
|
||||
DebuggerView.Filtering._doTokenSearch();
|
||||
};
|
||||
|
||||
let tokenSearch = document.getElementById("tokenSearchKey").getAttribute("key");
|
||||
let globalSearch = document.getElementById("globalSearchKey").getAttribute("key");
|
||||
let tokenSearchShortcut = Editor.accel(tokenSearch);
|
||||
let globalSearchShortcut = Editor.accel(globalSearch, { alt: true });
|
||||
extraKeys[tokenSearchShortcut] = () => this.Filtering._doTokenSearch();
|
||||
extraKeys[globalSearchShortcut] = () => this.Filtering._doGlobalSearch();
|
||||
extraKeys[Editor.keyFor("jumpToLine")] = false;
|
||||
|
||||
this.editor = new Editor({
|
||||
|
|
|
@ -689,9 +689,14 @@ CM_MAPPING.forEach(function (name) {
|
|||
* Returns a string representation of a shortcut 'key' with
|
||||
* a OS specific modifier. Cmd- for Macs, Ctrl- for other
|
||||
* platforms. Useful with extraKeys configuration option.
|
||||
*
|
||||
* CodeMirror defines all keys with modifiers in the following
|
||||
* order: Shift - Ctrl/Cmd - Alt - Key
|
||||
*/
|
||||
Editor.accel = function (key) {
|
||||
return (Services.appinfo.OS == "Darwin" ? "Cmd-" : "Ctrl-") + key;
|
||||
Editor.accel = function (key, modifiers={}) {
|
||||
return (modifiers.shift ? "Shift-" : "") +
|
||||
(Services.appinfo.OS == "Darwin" ? "Cmd-" : "Ctrl-") +
|
||||
(modifiers.alt ? "Alt-" : "") + key;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче