mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
hotkeys: Move copy_with_c shortcut definition and improve comments.
The `copy_handler` function that this shortcut calls is not useful unless the body of a Zulip message is selected, so we shouldn't try running it in other situations.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user