1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add new shortcut to clear debug message list

Clearing the debug message list is globally scoped by default to
`ctrl+alt+l`. Mnemonic: similar to clearing a terminal shell using
ctrl+l.
This commit is contained in:
Paul Williams 2019-05-30 09:36:44 +00:00
parent e0111d3fe6
commit e56fdecdc6
2 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@
"ctrl-space": "core:toggle-sidebar", "ctrl-space": "core:toggle-sidebar",
"ctrl-p": "core:toggle-palette", "ctrl-p": "core:toggle-palette",
"ctrl-,": "core:show-user-settings", "ctrl-,": "core:show-user-settings",
"ctrl-alt-l": "core:clear-debug-messages",
"ctrl-alt-r": "core:show-remote-diff", "ctrl-alt-r": "core:show-remote-diff",
"ctrl-alt-n": "core:new-project", "ctrl-alt-n": "core:new-project",
"ctrl-alt-o": "core:open-project", "ctrl-alt-o": "core:open-project",

View File

@ -205,6 +205,7 @@
} }
}; };
RED.events.on("project:change", this.clearMessageList); RED.events.on("project:change", this.clearMessageList);
RED.actions.add("core:clear-debug-messages", function() { RED.debug.clearMessageList(true) });
$("#debug-tab-open").click(function(e) { $("#debug-tab-open").click(function(e) {
e.preventDefault(); e.preventDefault();
@ -246,7 +247,8 @@
RED.sidebar.removeTab("debug"); RED.sidebar.removeTab("debug");
RED.events.off("workspace:change", this.refreshMessageList); RED.events.off("workspace:change", this.refreshMessageList);
window.removeEventListener("message",this.handleWindowMessage); window.removeEventListener("message",this.handleWindowMessage);
RED.actions.remove("core:show-debug"); RED.actions.remove("core:show-debug-tab");
RED.actions.remove("core:clear-debug-messages");
delete RED._debug; delete RED._debug;
}, },