Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hotkeys: Move copy_with_c shortcut definition and improve comments.

Tim Abbotte7e2340eda60
diff --git a/static/js/hotkey.js b/static/js/hotkey.js
index aee61e2cbd0..ad5ffba8425 100644
--- a/static/js/hotkey.js
+++ b/static/js/hotkey.js
@@ -759,7 +759,7 @@ export function process_hotkey(e, hotkey) {
return false;
}
- // Compose box hotkeys
+ // Shortcuts that are useful with an empty message feed, like opening compose.
switch (event_name) {
case "compose": // 'c': compose
compose_actions.start("stream", {trigger: "compose_hotkey"});
@@ -781,16 +781,14 @@ export function process_hotkey(e, hotkey) {
case "star_deprecated":
ui.maybe_show_deprecation_notice("*");
return true;
- case "copy_with_c":
- copy_and_paste.copy_handler();
- return true;
}
if (message_lists.current.empty()) {
return false;
}
- // Navigation shortcuts
+ // Shortcuts for navigation and other applications that require a
+ // nonempty message feed but do not depend on the selected message.
switch (event_name) {
case "down_arrow":
case "vim_down":
@@ -817,6 +815,9 @@ export function process_hotkey(e, hotkey) {
case "spacebar":
navigate.page_down();
return true;
+ case "copy_with_c":
+ copy_and_paste.copy_handler();
+ return true;
}
const msg = message_lists.current.selected_message();