]> granicus.if.org Git - neomutt/commitdiff
make %N optional for notmuch browser format
authorKirill A. Shutemov <kirill@shutemov.name>
Thu, 10 Oct 2013 18:34:57 +0000 (11:34 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 15:30:07 +0000 (16:30 +0100)
It will allow to have vfolder_format option like this:

set vfolder_format="%?N?*& ?%20f %6N %10n"

This format will mark all vfolders with new messages with '*':

                inbox      0          0
*            linux/mm      2        183
     linux/mm/commits      0         39
...

Without the patch all vforlders will be marked.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
browser.c

index 8a7dbad4dc1ec6955b3605fa1c1b365d17568cc3..2617c380cf927dc4b79cc8ca902f6ada13cca529 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -336,8 +336,12 @@ folder_format_str (char *dest, size_t destlen, size_t col, char op, const char *
 #ifdef USE_NOTMUCH
       if (mx_is_notmuch (folder->ff->name))
       {
-       snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
-       snprintf (dest, destlen, tmp, folder->ff->new);
+       if (!optional)
+       {
+         snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+         snprintf (dest, destlen, tmp, folder->ff->new);
+       } else if (!folder->ff->new)
+         optional = 0;
        break;
       }
 #endif