hotkeys: Add "p" to narrow to next unread PM thread.

This works simimlar to the "n" key for next topics.

This commit does a few things:

    * It wires up the hotkey to an existing function
      that could change narrows.
    * It adds documentation.
    * It adds logic to make sure the compose box does
      not open.

@showell helped a bit with the wording of comments here.

Fixes #4874
This commit is contained in:
Abhigyan Khaund
2018-02-16 20:26:25 +05:30
committed by Steve Howell
parent 68664acf1f
commit a75f0aa594
6 changed files with 33 additions and 4 deletions

View File

@@ -94,6 +94,7 @@ var keypress_mappings = {
106: {name: 'vim_down', message_view_only: true}, // 'j'
107: {name: 'vim_up', message_view_only: true}, // 'k'
110: {name: 'n_key', message_view_only: false}, // 'n'
112: {name: 'p_key', message_view_only: false}, // 'p'
113: {name: 'query_streams', message_view_only: false}, // 'q'
114: {name: 'reply_message', message_view_only: true}, // 'r'
115: {name: 'narrow_by_recipient', message_view_only: true}, // 's'
@@ -630,6 +631,9 @@ exports.process_hotkey = function (e, hotkey) {
case 'n_key':
narrow.narrow_to_next_topic();
return true;
case 'p_key':
narrow.narrow_to_next_pm_string();
return true;
case 'open_drafts':
drafts.launch();
return true;