Skip to content

Commit

Permalink
index: use menu helper
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Jan 5, 2022
1 parent 2fa0256 commit dcb65f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions color/regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ enum CommandResult add_pattern(struct RegexColorList *rcl, const char *s,
cs_subset_string(NeoMutt->sub, "simple_search");
mutt_check_simple(buf, NONULL(c_simple_search));
struct Mailbox *m_cur = get_current_mailbox();
rcol->color_pattern = mutt_pattern_comp(m_cur, Context ? Context->menu : NULL,
buf->data, MUTT_PC_FULL_MSG, err);
struct Menu *menu = get_current_menu();
rcol->color_pattern =
mutt_pattern_comp(m_cur, menu, buf->data, MUTT_PC_FULL_MSG, err);
mutt_buffer_pool_release(&buf);
if (!rcol->color_pattern)
{
Expand Down
7 changes: 4 additions & 3 deletions hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s,
comp_flags = MUTT_PC_FULL_MSG;

struct Mailbox *m_cur = get_current_mailbox();
pat = mutt_pattern_comp(m_cur, Context ? Context->menu : NULL,
mutt_buffer_string(pattern), comp_flags, err);
struct Menu *menu = get_current_menu();
pat = mutt_pattern_comp(m_cur, menu, mutt_buffer_string(pattern), comp_flags, err);
if (!pat)
goto cleanup;
}
Expand Down Expand Up @@ -441,8 +441,9 @@ enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s,
* used for date ranges, and they need to be evaluated relative to "now", not
* the hook compilation time. */
struct Mailbox *m_cur = get_current_mailbox();
struct Menu *menu = get_current_menu();
struct PatternList *pat =
mutt_pattern_comp(m_cur, Context ? Context->menu : NULL, mutt_buffer_string(pattern),
mutt_pattern_comp(m_cur, menu, mutt_buffer_string(pattern),
MUTT_PC_FULL_MSG | MUTT_PC_PATTERN_DYNAMIC, err);
if (!pat)
goto out;
Expand Down
5 changes: 3 additions & 2 deletions score.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ enum CommandResult mutt_parse_score(struct Buffer *buf, struct Buffer *s,
if (!ptr)
{
struct Mailbox *m_cur = get_current_mailbox();
struct PatternList *pat = mutt_pattern_comp(m_cur, Context ? Context->menu : NULL,
pattern, MUTT_PC_NO_FLAGS, err);
struct Menu *menu = get_current_menu();
struct PatternList *pat =
mutt_pattern_comp(m_cur, menu, pattern, MUTT_PC_NO_FLAGS, err);
if (!pat)
{
FREE(&pattern);
Expand Down

0 comments on commit dcb65f7

Please sign in to comment.