Commit 14e37771 authored by Vincent Lefevre's avatar Vincent Lefevre

Add %R (number of read messages) for $status_format.

parent d1659601
......@@ -3560,6 +3560,7 @@ struct option_t MuttVars[] = {
** .dt %P .dd percentage of the way through the index
** .dt %r .dd modified/read-only/won't-write/attach-message indicator,
** according to $$status_chars
** .dt %R .dd number of read messages *
** .dt %s .dd current sorting mode ($$sort)
** .dt %S .dd current aux sorting method ($$sort_aux)
** .dt %t .dd number of tagged messages *
......
......@@ -55,6 +55,7 @@ static void _menu_status_line (char *buf, size_t buflen, size_t col, int cols, M
* %p = number of postponed messages [option]
* %P = percent of way through index
* %r = readonly/wontwrite/changed flag
* %R = number of read messages [option]
* %s = current sorting method ($sort)
* %S = current aux sorting method ($sort_aux)
* %t = # of tagged messages [option]
......@@ -236,7 +237,21 @@ status_format_str (char *buf, size_t buflen, size_t col, int cols, char op, cons
snprintf (buf, buflen, "%s", StChars->chars[i]);
break;
}
case 'R':
{
int read = Context ? Context->msgcount - Context->unread : 0;
if (!optional)
{
snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
snprintf (buf, buflen, fmt, read);
}
else if (!read)
optional = 0;
break;
}
case 's':
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
snprintf (buf, buflen, fmt,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment