hotkeys: Map CTRL + . to narrow to compose box target.

Also adds relevant tests and documentation. We currently
do not narrow to a new topic, and instead just narrow to
the stream. Similarly, we do not narrow to a PM if any of
the recipients are invalid.
This commit is contained in:
Rohitt Vashishtha
2018-11-29 23:20:10 +00:00
committed by Tim Abbott
parent 3079cf803c
commit ee3b4f3ee9
7 changed files with 185 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ var keydown_ctrl_mappings = {
var keydown_cmd_or_ctrl_mappings = {
75: {name: 'search_with_k', message_view_only: false}, // 'K'
83: {name: 'star_message', message_view_only: true}, // 's'
190: {name: 'narrow_to_compose_target', message_view_only: true}, // '.'
};
var keydown_either_mappings = {
@@ -552,6 +553,11 @@ exports.process_hotkey = function (e, hotkey) {
}
}
if (event_name === 'narrow_to_compose_target') {
narrow.to_compose_target();
return true;
}
// Process hotkeys specially when in an input, select, textarea, or send button
if (exports.processing_text()) {
// Note that there is special handling for enter/escape too, but