47#define MUTT_SEARCH_UP 1
48#define MUTT_SEARCH_DOWN 2
75 if (!(search_buf && *search_buf) || ((op != OP_SEARCH_NEXT) && (op != OP_SEARCH_OPPOSITE)))
77 buf_strcpy(buf, search_buf && (search_buf[0] !=
'\0') ? search_buf :
"");
78 if ((
mw_get_field(((op == OP_SEARCH) || (op == OP_SEARCH_NEXT)) ?
_(
"Search for: ") :
_(
"Reverse search for: "),
90 menu->
search_dir = ((op == OP_SEARCH) || (op == OP_SEARCH_NEXT)) ?
96 if (op == OP_SEARCH_OPPOSITE)
97 search_dir = -search_dir;
102 reg_rc =
REG_COMP(&re, search_buf, REG_NOSUB | flags);
107 regerror(reg_rc, &re, buf->
data, buf->
dsize);
112 *match = menu->
current + search_dir;
116 while ((*match >= 0) && (*match < menu->max))
118 if (menu->
search(menu, &re, *match) == 0)
125 *match += search_dir;
129 if (c_wrap_search && (wrap++ == 0))
131 *match = (search_dir == 1) ? 0 : menu->
max - 1;
168 const int old_top = menu->
top;
172 const int count =
event->count;
179 case OP_CURRENT_BOTTOM:
183 case OP_CURRENT_MIDDLE:
271 const int rc =
search(menu, event->
op, &index);
305 int num =
event->count;
315 if (!mutt_str_atoi_full(
buf_string(buf), &num) || (num < 1) || (num > menu->
max))
368 if (!event || !win || !win->
wdata)
371 const int op =
event->op;
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
void dispatcher_flush_on_error(int rv)
Flush pending keys after a dispatch error.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_NO_ACTION
Valid function - no action performed.
@ MUTT_COMP_CLEAR
Clear input if printable character is pressed.
@ MUTT_COMP_NONE
No flags are set.
static int op_jump(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Jump to an index number - Implements alias_function_t -.
int menu_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Menu function - Implements function_dispatcher_t -.
static int op_help(struct EnterFunctionData *fdata, const struct KeyEvent *event)
Display Help - Implements enter_function_t -.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
void mutt_help(const struct MenuDefinition *md)
Display the Help Page.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
@ LL_DEBUG1
Log at debug level 1.
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
@ MODULE_ID_MENU
ModuleMenu, Menu
Convenience wrapper for the library headers.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
const char * opcodes_get_name(int op)
Get the name of an opcode.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
void * wdata
Private data.
Container for Accounts, Notifications.