58 {
"sidebar-first", OP_SIDEBAR_FIRST },
59 {
"sidebar-last", OP_SIDEBAR_LAST },
60 {
"sidebar-next", OP_SIDEBAR_NEXT },
61 {
"sidebar-next-new", OP_SIDEBAR_NEXT_NEW },
62 {
"sidebar-open", OP_SIDEBAR_OPEN },
63 {
"sidebar-page-down", OP_SIDEBAR_PAGE_DOWN },
64 {
"sidebar-page-up", OP_SIDEBAR_PAGE_UP },
65 {
"sidebar-prev", OP_SIDEBAR_PREV },
66 {
"sidebar-prev-new", OP_SIDEBAR_PREV_NEW },
67 {
"sidebar-abort-search", OP_SIDEBAR_ABORT_SEARCH },
68 {
"sidebar-start-search", OP_SIDEBAR_START_SEARCH },
69 {
"sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL },
70 {
"sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE },
78 { OP_SIDEBAR_NEXT,
"<down>" },
79 { OP_SIDEBAR_PREV,
"<up>" },
121 if (!(*sbep)->is_hidden)
123 wdata->
hil_index = ARRAY_FOREACH_IDX_sbep;
144 if ((*sbep)->mailbox->has_new || ((*sbep)->mailbox->msg_unread != 0))
157 struct SbEntry **sbep = NULL, **prev = NULL;
160 if (!(*sbep)->is_hidden)
183 struct SbEntry **sbep = NULL, **prev = NULL;
186 if ((*sbep)->mailbox->has_new || ((*sbep)->mailbox->msg_unread != 0))
273 if ((max_entries == 0) || (wdata->
hil_index < 0))
314 int orig_hil_index =
wdata->hil_index;
322 if (orig_hil_index ==
wdata->hil_index)
340 int orig_hil_index =
wdata->hil_index;
348 if (orig_hil_index ==
wdata->hil_index)
384 if ((max_entries == 0) || (
wdata->hil_index < 0))
390 (c_sidebar_next_new_wrap &&
428 wdata->hil_index = -1;
429 wdata->repage =
true;
441 wdata->
hil_index = ARRAY_FOREACH_IDX_sbep;
468 if ((best_score == -1) || (
score > best_score))
471 best_index = ARRAY_FOREACH_IDX_sbep;
481 if (best_index != -1)
526 if (sbe->
box[0] ==
'\0')
556 (*sbep)->mailbox->visible =
true;
607 if (!event || !win || !win->
wdata)
610 const int op =
event->op;
#define ARRAY_IDX(head, elem)
Return the index of an element of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_FOREACH_TO(elem, head, to)
Iterate from the beginning to an index.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
#define ARRAY_GET(head, idx)
Return the element at index.
#define ARRAY_FOREACH_FROM_TO(elem, head, from, to)
Iterate between two indexes.
int bool_str_toggle(struct ConfigSubset *sub, const char *name, struct Buffer *err)
Toggle the value of a bool.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
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.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_NO_ACTION
Valid function - no action performed.
void index_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
struct SubMenu * SmEditor
Editor functions.
int mw_get_field_notify(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata, get_field_callback_t callback, void *cb_data, const struct MenuDefinition *md, function_dispatcher_t fn_disp)
Ask the user for a string and call a notify function on keypress.
#define MUTT_COMP_UNBUFFERED
Ignore macro buffer.
@ FUZZY_ALGO_SUBSEQ
Subsequence matching algorithm.
int fuzzy_match(const char *pattern, const char *candidate, enum FuzzyAlgo algo, const struct FuzzyOptions *opts, struct FuzzyResult *out)
Perform fuzzy matching.
int sb_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Sidebar function - Implements function_dispatcher_t -.
#define mutt_warning(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
GUI manage the main index (list of emails)
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
@ LL_DEBUG1
Log at debug level 1.
Convenience wrapper for the library headers.
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
#define WA_RECALC
Recalculate the contents of the Window.
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.
String manipulation buffer.
Options for fuzzy matching.
An event such as a keypress.
int msg_new
Number of new messages.
bool visible
True if a result of "mailboxes".
int msg_unread
Number of unread messages.
void * wdata
Private data.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Info about folders in the sidebar.
int score
Fuzzy-match score.
char display[256]
Formatted string to display.
struct Mailbox * mailbox
Mailbox this represents.
char box[256]
Mailbox path (possibly abbreviated)
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
@ MENU_SIDEBAR
Sidebar menu.