Skip to content

Commit

Permalink
add separate key binding for next/prev page when composing message
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Jun 29, 2024
1 parent a5ba98c commit 2f39d9f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,13 @@ file (platform-dependent defaults are left empty below):
key_move=m
key_next_msg=n
key_next_page=KEY_NPAGE
key_next_page_compose=KEY_NPAGE
key_open=.
key_othercmd_help=o
key_postpone=KEY_CTRLO
key_prev_msg=p
key_prev_page=KEY_PPAGE
key_prev_page_compose=KEY_PPAGE
key_quit=q
key_refresh=l
key_reply_all=r
Expand Down
2 changes: 1 addition & 1 deletion src/nmail.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
.TH NMAIL "1" "June 2024" "nmail v4.71" "User Commands"
.TH NMAIL "1" "June 2024" "nmail v4.72" "User Commands"
.SH NAME
nmail \- ncurses mail
.SH SYNOPSIS
Expand Down
14 changes: 9 additions & 5 deletions src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ void Ui::Init()
{ "key_end_line", "KEY_CTRLE" },
{ "key_prev_page", "KEY_PPAGE" },
{ "key_next_page", "KEY_NPAGE" },
{ "key_prev_page_compose", "KEY_PPAGE" },
{ "key_next_page_compose", "KEY_NPAGE" },
{ "key_filter_sort_reset", "`" },
{ "key_filter_show_unread", "1" },
{ "key_filter_show_has_attachments", "2" },
Expand Down Expand Up @@ -236,6 +238,8 @@ void Ui::Init()
m_KeyEndLine = Util::GetKeyCode(m_Config.Get("key_end_line"));
m_KeyPrevPage = Util::GetKeyCode(m_Config.Get("key_prev_page"));
m_KeyNextPage = Util::GetKeyCode(m_Config.Get("key_next_page"));
m_KeyPrevPageCompose = Util::GetKeyCode(m_Config.Get("key_prev_page_compose"));
m_KeyNextPageCompose = Util::GetKeyCode(m_Config.Get("key_next_page_compose"));
m_KeyFilterSortReset = Util::GetKeyCode(m_Config.Get("key_filter_sort_reset"));
m_KeyFilterShowUnread = Util::GetKeyCode(m_Config.Get("key_filter_show_unread"));
m_KeyFilterShowHasAttachments = Util::GetKeyCode(m_Config.Get("key_filter_show_has_attachments"));
Expand Down Expand Up @@ -2991,12 +2995,12 @@ void Ui::ComposeMessageKeyHandler(int p_Key)
m_IsComposeHeader = false;
}
}
else if (p_Key == m_KeyPrevPage)
else if (p_Key == m_KeyPrevPageCompose)
{
m_ComposeHeaderLine = 0;
m_ComposeHeaderPos = 0;
}
else if (p_Key == m_KeyNextPage)
else if (p_Key == m_KeyNextPageCompose)
{
m_IsComposeHeader = false;
}
Expand Down Expand Up @@ -3077,7 +3081,7 @@ void Ui::ComposeMessageKeyHandler(int p_Key)
{
ComposeMessageNextLine();
}
else if (p_Key == m_KeyPrevPage)
else if (p_Key == m_KeyPrevPageCompose)
{
const bool processFlowed = false; // only process when viewing message
const bool outputFlowed = false; // only generate when sending after compose
Expand All @@ -3092,7 +3096,7 @@ void Ui::ComposeMessageKeyHandler(int p_Key)
m_ComposeMessageWrapPos);
}
}
else if (p_Key == m_KeyNextPage)
else if (p_Key == m_KeyNextPageCompose)
{
const bool processFlowed = false; // only process when viewing message
const bool outputFlowed = false; // only generate when sending after compose
Expand Down Expand Up @@ -5239,7 +5243,7 @@ bool Ui::PromptString(const std::string& p_Prompt, const std::string& p_Action,
break;
}
else if ((key == KEY_UP) || (key == KEY_DOWN) ||
(key == m_KeyPrevPage) || (key == m_KeyNextPage) ||
(key == m_KeyPrevPageCompose) || (key == m_KeyNextPageCompose) ||
(key == KEY_HOME) || (key == KEY_END))
{
// ignore
Expand Down
2 changes: 2 additions & 0 deletions src/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ class Ui
int m_KeyEndLine = 0;
int m_KeyPrevPage = 0;
int m_KeyNextPage = 0;
int m_KeyPrevPageCompose = 0;
int m_KeyNextPageCompose = 0;
int m_KeyFilterSortReset = 0;
int m_KeyFilterShowUnread = 0;
int m_KeyFilterShowHasAttachments = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "version.h"

#define NMAIL_VERSION "4.71"
#define NMAIL_VERSION "4.72"

std::string Version::GetBuildOs()
{
Expand Down

0 comments on commit 2f39d9f

Please sign in to comment.