Skip to content

Commit

Permalink
Fix built-in pager checks for help and attachments
Browse files Browse the repository at this point in the history
Mutt uses the built-in pager when $pager is unset too.  Fix a few
checks to also handle that case.

Co-authored-by: Richard Russon <[email protected]>
  • Loading branch information
kevin8t8 and flatcap committed Oct 8, 2019
1 parent 60809ac commit 1ded94a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion help.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static void format_line(FILE *fp, int ismacro, const char *t1, const char *t2, c

if (ismacro > 0)
{
if (mutt_str_strcmp(C_Pager, "builtin") == 0)
if (!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0))
fputs("_\010", fp); // Ctrl-H (backspace)
fputs("M ", fp);
col += 2;
Expand Down
10 changes: 8 additions & 2 deletions state.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ void state_mark_attach(struct State *s)
{
if (!s || !s->fp_out)
return;
if ((s->flags & MUTT_DISPLAY) && (mutt_str_strcmp(C_Pager, "builtin") == 0))
if ((s->flags & MUTT_DISPLAY) &&
(!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0)))
{
state_puts(AttachmentMarker, s);
}
}

/**
Expand All @@ -52,8 +55,11 @@ void state_mark_attach(struct State *s)
*/
void state_mark_protected_header(struct State *s)
{
if ((s->flags & MUTT_DISPLAY) && (mutt_str_strcmp(C_Pager, "builtin") == 0))
if ((s->flags & MUTT_DISPLAY) &&
(!C_Pager || (mutt_str_strcmp(C_Pager, "builtin") == 0)))
{
state_puts(ProtectedHeaderMarker, s);
}
}

/**
Expand Down

0 comments on commit 1ded94a

Please sign in to comment.