mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
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:
committed by
Steve Howell
parent
68664acf1f
commit
a75f0aa594
@@ -384,7 +384,17 @@ exports.quote_and_reply = function (opts) {
|
||||
});
|
||||
};
|
||||
|
||||
exports.on_narrow = function () {
|
||||
exports.on_narrow = function (opts) {
|
||||
// We use force_close when jumping between PM narrows with the "p" key,
|
||||
// so that we don't have an open compose box that makes it difficult
|
||||
// to cycle quickly through unread messages.
|
||||
if (opts.force_close) {
|
||||
// This closes the compose box if it was already open, and it is
|
||||
// basically a noop otherwise.
|
||||
exports.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (narrow_state.narrowed_by_topic_reply()) {
|
||||
exports.on_topic_narrow();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user