NeoMutt  2025-12-11-1009-ga75d9e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions_sidebar.c File Reference

Sidebar functions. More...

#include "config.h"
#include <stdbool.h>
#include <string.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "functions_sidebar.h"
#include "lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "index/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "functions_fuzzy.h"
#include "module_data.h"
Include dependency graph for functions_sidebar.c:

Go to the source code of this file.

Functions

void sidebar_init_keys (struct NeoMutt *n, struct SubMenu *sm_generic)
 Initialise the Sidebar Keybindings - Implements ::init_keys_api.
struct SubMenusidebar_get_submenu (void)
 Get the Sidebar SubMenu.
bool sb_next (struct SidebarWindowData *wdata)
 Find the next unhidden Mailbox.
static bool sb_next_n (struct SidebarWindowData *wdata, int count)
 Move down N unhidden Mailboxes, capping at the last.
static bool sb_prev_n (struct SidebarWindowData *wdata, int count)
 Move up N unhidden Mailboxes, capping at the first.
static struct SbEntry ** sb_next_new (struct SidebarWindowData *wdata, size_t begin, size_t end)
 Return the next mailbox with new messages.
bool sb_prev (struct SidebarWindowData *wdata)
 Find the previous unhidden Mailbox.
static struct SbEntry ** sb_prev_new (struct SidebarWindowData *wdata, size_t begin, size_t end)
 Return the previous mailbox with new messages.
static int sb_screen_row_index (struct SidebarWindowData *wdata, int wanted_row)
 Find the entry shown at a given row of the visible page.
static int sb_index_visible_before (struct SidebarWindowData *wdata, int index, int count)
 Find the entry N unhidden entries before another.
static int sb_index_visible_after (struct SidebarWindowData *wdata, int index, int count)
 Find the entry N unhidden entries after another.
static int sb_last_visible (struct SidebarWindowData *wdata)
 Find the last unhidden entry.
static int sb_scroll_view (struct SidebarFunctionData *fdata, int delta)
 Scroll the viewport, dragging the selection into view.
int op_sidebar_first (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the first unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_select_entry_by_number (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Jump to a specific mailbox - Implements sidebar_function_t -.
int op_sidebar_last (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the last unhidden mailbox - Implements sidebar_function_t -.
int op_sidebar_next (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the next unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_next_new (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the next new mailbox - Implements sidebar_function_t -.
int op_sidebar_open (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Open highlighted mailbox - Implements sidebar_function_t -.
int op_sidebar_prev (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the previous unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_prev_new (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the previous new mailbox - Implements sidebar_function_t -.
static int op_sidebar_select_page_top (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the entry at the top of the visible page - Implements sidebar_function_t -.
static int op_sidebar_select_page_middle (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the entry at the middle of the visible page - Implements sidebar_function_t -.
static int op_sidebar_select_page_bottom (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Selects the entry at the bottom of the visible page - Implements sidebar_function_t -.
static int op_sidebar_scroll_half_down (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls down by half a page - Implements sidebar_function_t -.
static int op_sidebar_scroll_half_up (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls up by half a page - Implements sidebar_function_t -.
static int op_sidebar_scroll_line_down (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls down by one line - Implements sidebar_function_t -.
static int op_sidebar_scroll_line_up (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls up by one line - Implements sidebar_function_t -.
int op_sidebar_scroll_page_down (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls down by one page - Implements sidebar_function_t -.
int op_sidebar_scroll_page_up (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls up by one page - Implements sidebar_function_t -.
static int sb_scroll_selection_to_row (struct SidebarFunctionData *fdata, int wanted_row)
 Scroll the view so the selection is at a given row.
static int op_sidebar_scroll_selection_to_top (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls so the selection is at the top of the screen - Implements sidebar_function_t -.
static int op_sidebar_scroll_selection_to_middle (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls so the selection is at the middle of the screen - Implements sidebar_function_t -.
static int op_sidebar_scroll_selection_to_bottom (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Scrolls so the selection is at the bottom of the screen - Implements sidebar_function_t -.
static int op_sidebar_toggle_visible (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Make the sidebar (in)visible - Implements sidebar_function_t -.
static int op_sidebar_toggle_virtual (struct SidebarFunctionData *fdata, const struct KeyEvent *event)
 Deprecated - Implements sidebar_function_t -.
int sb_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Sidebar function - Implements function_dispatcher_t -.

Variables

static const struct MenuFuncOp OpSidebar []
 Functions for the Sidebar Window.
const struct MenuOpSeq SidebarDefaultBindings []
 Key bindings for the Sidebar Window.
static const struct SidebarFunction SidebarFunctions []
 All the NeoMutt functions that the Sidebar supports.

Detailed Description

Sidebar functions.

Authors
  • Pietro Cerutti
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions_sidebar.c.

Function Documentation

◆ sidebar_init_keys()

void sidebar_init_keys ( struct NeoMutt * n,
struct SubMenu * sm_generic )

Initialise the Sidebar Keybindings - Implements ::init_keys_api.

Definition at line 90 of file functions_sidebar.c.

91{
93 ASSERT(mod_data);
94
95 struct MenuDefinition *md = NULL;
96 struct SubMenu *sm = NULL;
97 struct SubMenu *sm_editor = editor_get_submenu();
98 ASSERT(sm_editor);
99
101 md = km_register_menu(MENU_SIDEBAR, "sidebar");
102 km_menu_add_submenu(md, sm);
103 km_menu_add_submenu(md, sm_editor);
105
106 mod_data->md_sidebar = md;
107 mod_data->sm_sidebar = sm;
108}
struct SubMenu * editor_get_submenu(void)
Get the Editor SubMenu.
Definition functions.c:587
const struct MenuOpSeq SidebarDefaultBindings[]
Key bindings for the Sidebar Window.
static const struct MenuFuncOp OpSidebar[]
Functions for the Sidebar Window.
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:88
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:105
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
@ MODULE_ID_SIDEBAR
ModuleSidebar, Sidebar
Definition module_api.h:93
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:666
#define ASSERT(COND)
Definition signal2.h:59
Functions for a Dialog or Window.
Definition menudef.h:44
Sidebar private Module data.
Definition module_data.h:32
struct MenuDefinition * md_sidebar
Sidebar Menu Definition.
Definition module_data.h:34
struct SubMenu * sm_sidebar
Sidebar functions.
Definition module_data.h:35
Collection of related functions.
Definition menudef.h:33
@ MENU_SIDEBAR
Sidebar menu.
Definition type.h:51
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sidebar_get_submenu()

struct SubMenu * sidebar_get_submenu ( void )

Get the Sidebar SubMenu.

Return values
ptrSidebar SubMenu

Definition at line 114 of file functions_sidebar.c.

115{
117 ASSERT(mod_data);
118
119 return mod_data->sm_sidebar;
120}
Container for Accounts, Notifications.
Definition neomutt.h:41
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sb_next()

bool sb_next ( struct SidebarWindowData * wdata)

Find the next unhidden Mailbox.

Parameters
wdataSidebar data
Return values
trueMailbox found

Definition at line 127 of file functions_sidebar.c.

128{
129 struct SbEntry **sbep = NULL;
130 ARRAY_FOREACH_FROM(sbep, &wdata->entries, wdata->hil_index + 1)
131 {
132 if (!(*sbep)->is_hidden)
133 {
134 wdata->hil_index = ARRAY_FOREACH_IDX_sbep;
135 return true;
136 }
137 }
138
139 return false;
140}
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
Definition array.h:235
Info about folders in the sidebar.
Definition private.h:40
int hil_index
Highlighted mailbox.
Definition private.h:97
struct SbEntryArray entries
Items to display in the sidebar.
Definition private.h:93
Here is the caller graph for this function:

◆ sb_next_n()

bool sb_next_n ( struct SidebarWindowData * wdata,
int count )
static

Move down N unhidden Mailboxes, capping at the last.

Parameters
wdataSidebar data
countNumber of entries to move
Return values
trueMoved at least one entry
falseAlready at the last unhidden entry

Definition at line 149 of file functions_sidebar.c.

150{
151 int orig = wdata->hil_index;
152 for (int i = 0; i < count; i++)
153 {
154 if (!sb_next(wdata))
155 break;
156 }
157 return (wdata->hil_index != orig);
158}
bool sb_next(struct SidebarWindowData *wdata)
Find the next unhidden Mailbox.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sb_prev_n()

bool sb_prev_n ( struct SidebarWindowData * wdata,
int count )
static

Move up N unhidden Mailboxes, capping at the first.

Parameters
wdataSidebar data
countNumber of entries to move
Return values
trueMoved at least one entry
falseAlready at the first unhidden entry

Definition at line 167 of file functions_sidebar.c.

168{
169 int orig = wdata->hil_index;
170 for (int i = 0; i < count; i++)
171 {
172 if (!sb_prev(wdata))
173 break;
174 }
175 return (wdata->hil_index != orig);
176}
bool sb_prev(struct SidebarWindowData *wdata)
Find the previous unhidden Mailbox.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sb_next_new()

struct SbEntry ** sb_next_new ( struct SidebarWindowData * wdata,
size_t begin,
size_t end )
static

Return the next mailbox with new messages.

Parameters
wdataSidebar data
beginStarting index for searching
endEnding index for searching
Return values
ptrPointer to the first entry with new messages
NULLNone could be found

Definition at line 186 of file functions_sidebar.c.

187{
188 struct SbEntry **sbep = NULL;
189 ARRAY_FOREACH_FROM_TO(sbep, &wdata->entries, begin, end)
190 {
191 if ((*sbep)->mailbox->has_new || ((*sbep)->mailbox->msg_unread != 0))
192 return sbep;
193 }
194 return NULL;
195}
#define ARRAY_FOREACH_FROM_TO(elem, head, from, to)
Iterate between two indexes.
Definition array.h:261
Here is the caller graph for this function:

◆ sb_prev()

bool sb_prev ( struct SidebarWindowData * wdata)

Find the previous unhidden Mailbox.

Parameters
wdataSidebar data
Return values
trueMailbox found

Definition at line 202 of file functions_sidebar.c.

203{
204 struct SbEntry **sbep = NULL, **prev = NULL;
205 ARRAY_FOREACH_TO(sbep, &wdata->entries, wdata->hil_index)
206 {
207 if (!(*sbep)->is_hidden)
208 prev = sbep;
209 }
210
211 if (prev)
212 {
213 wdata->hil_index = ARRAY_IDX(&wdata->entries, prev);
214 return true;
215 }
216
217 return false;
218}
#define ARRAY_IDX(head, elem)
Return the index of an element of the array.
Definition array.h:324
#define ARRAY_FOREACH_TO(elem, head, to)
Iterate from the beginning to an index.
Definition array.h:247
Here is the caller graph for this function:

◆ sb_prev_new()

struct SbEntry ** sb_prev_new ( struct SidebarWindowData * wdata,
size_t begin,
size_t end )
static

Return the previous mailbox with new messages.

Parameters
wdataSidebar data
beginStarting index for searching
endEnding index for searching
Return values
ptrPointer to the first entry with new messages
NULLNone could be found

Definition at line 228 of file functions_sidebar.c.

229{
230 struct SbEntry **sbep = NULL, **prev = NULL;
231 ARRAY_FOREACH_FROM_TO(sbep, &wdata->entries, begin, end)
232 {
233 if ((*sbep)->mailbox->has_new || ((*sbep)->mailbox->msg_unread != 0))
234 prev = sbep;
235 }
236
237 return prev;
238}
Here is the caller graph for this function:

◆ sb_screen_row_index()

int sb_screen_row_index ( struct SidebarWindowData * wdata,
int wanted_row )
static

Find the entry shown at a given row of the visible page.

Parameters
wdataSidebar data
wanted_rowRow within the page (0 = top)
Return values
numIndex into wdata->entries
-1No entry found

If the requested row is beyond the last visible entry, the last visible entry on the page is returned.

Definition at line 250 of file functions_sidebar.c.

251{
252 if ((wdata->top_index < 0) || (wanted_row < 0))
253 return -1;
254
255 const int page_size = wdata->win->state.rows;
256 int row = 0;
257 int last = -1;
258
259 struct SbEntry **sbep = NULL;
260 ARRAY_FOREACH_FROM(sbep, &wdata->entries, wdata->top_index)
261 {
262 if (row >= page_size)
263 break;
264 if ((*sbep)->is_hidden)
265 continue;
266
267 last = ARRAY_FOREACH_IDX_sbep;
268 if (row == wanted_row)
269 return last;
270 row++;
271 }
272
273 return last; // clamp to the last visible entry on the page
274}
struct WindowState state
Current state of the Window.
int top_index
First mailbox visible in sidebar.
Definition private.h:95
struct MuttWindow * win
Sidebar Window.
Definition private.h:91
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:61
Here is the caller graph for this function:

◆ sb_index_visible_before()

int sb_index_visible_before ( struct SidebarWindowData * wdata,
int index,
int count )
static

Find the entry N unhidden entries before another.

Parameters
wdataSidebar data
indexStarting index
countNumber of unhidden entries to move up
Return values
numIndex into wdata->entries (capped at the first unhidden entry)

Definition at line 283 of file functions_sidebar.c.

284{
285 int top = index;
286 for (int i = 0; i < count; i++)
287 {
288 int prev = -1;
289 struct SbEntry **sbep = NULL;
290 ARRAY_FOREACH_TO(sbep, &wdata->entries, top)
291 {
292 if (!(*sbep)->is_hidden)
293 prev = ARRAY_FOREACH_IDX_sbep;
294 }
295
296 if (prev < 0)
297 break;
298 top = prev;
299 }
300
301 return top;
302}
Here is the caller graph for this function:

◆ sb_index_visible_after()

int sb_index_visible_after ( struct SidebarWindowData * wdata,
int index,
int count )
static

Find the entry N unhidden entries after another.

Parameters
wdataSidebar data
indexStarting index
countNumber of unhidden entries to move down
Return values
numIndex into wdata->entries (capped at the last unhidden entry)

Definition at line 311 of file functions_sidebar.c.

312{
313 int pos = index;
314 for (int i = 0; i < count; i++)
315 {
316 int next = -1;
317 struct SbEntry **sbep = NULL;
318 ARRAY_FOREACH_FROM(sbep, &wdata->entries, pos + 1)
319 {
320 if (!(*sbep)->is_hidden)
321 {
322 next = ARRAY_FOREACH_IDX_sbep;
323 break;
324 }
325 }
326
327 if (next < 0)
328 break;
329 pos = next;
330 }
331
332 return pos;
333}
Here is the caller graph for this function:

◆ sb_last_visible()

int sb_last_visible ( struct SidebarWindowData * wdata)
static

Find the last unhidden entry.

Parameters
wdataSidebar data
Return values
numIndex into wdata->entries
-1No visible entry found

Definition at line 341 of file functions_sidebar.c.

342{
343 int last = -1;
344 struct SbEntry **sbep = NULL;
345 ARRAY_FOREACH(sbep, &wdata->entries)
346 {
347 if (!(*sbep)->is_hidden)
348 last = ARRAY_FOREACH_IDX_sbep;
349 }
350
351 return last;
352}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
Here is the caller graph for this function:

◆ sb_scroll_view()

int sb_scroll_view ( struct SidebarFunctionData * fdata,
int delta )
static

Scroll the viewport, dragging the selection into view.

Parameters
fdataSidebar function data
deltaNumber of visible entries to scroll (negative = up)
Return values
enumFunctionRetval

Move the viewport (top_index) by delta visible entries. The selection (highlight) is left unchanged unless it would fall off the screen, in which case it is dragged to the nearest visible row. This mirrors the Menu.

Definition at line 364 of file functions_sidebar.c.

365{
366 struct SidebarWindowData *wdata = fdata->wdata;
367 if (!mutt_window_is_visible(wdata->win))
368 return FR_NO_ACTION;
369
370 if (ARRAY_EMPTY(&wdata->entries) || (wdata->hil_index < 0) || (wdata->top_index < 0))
371 return FR_NO_ACTION;
372
373 const int page_size = wdata->win->state.rows;
374
375 int new_top;
376 if (delta < 0)
377 new_top = sb_index_visible_before(wdata, wdata->top_index, -delta);
378 else
379 new_top = sb_index_visible_after(wdata, wdata->top_index, delta);
380
381 /* Tie the last entry to the bottom of the screen (don't scroll into space) */
382 const int last = sb_last_visible(wdata);
383 if (last >= 0)
384 {
385 const int max_top = sb_index_visible_before(wdata, last, page_size - 1);
386 if (new_top > max_top)
387 new_top = max_top;
388 }
389
390 if (new_top == wdata->top_index)
391 return FR_NO_ACTION;
392
393 wdata->top_index = new_top;
394
395 /* Drag the selection into the visible range */
396 const int first = sb_screen_row_index(wdata, 0);
397 const int bottom = sb_screen_row_index(wdata, page_size - 1);
398 if ((first >= 0) && (wdata->hil_index < first))
399 wdata->hil_index = first;
400 else if ((bottom >= 0) && (wdata->hil_index > bottom))
401 wdata->hil_index = bottom;
402
403 wdata->win->actions |= WA_RECALC;
404 return FR_SUCCESS;
405}
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
@ FR_NO_ACTION
Valid function - no action performed.
Definition dispatcher.h:38
static int sb_index_visible_after(struct SidebarWindowData *wdata, int index, int count)
Find the entry N unhidden entries after another.
static int sb_index_visible_before(struct SidebarWindowData *wdata, int index, int count)
Find the entry N unhidden entries before another.
static int sb_screen_row_index(struct SidebarWindowData *wdata, int wanted_row)
Find the entry shown at a given row of the visible page.
static int sb_last_visible(struct SidebarWindowData *wdata)
Find the last unhidden entry.
bool mutt_window_is_visible(struct MuttWindow *win)
Is the Window visible?
@ WA_RECALC
Recalculate the contents of the Window.
void * wdata
Private data.
struct SidebarWindowData * wdata
Sidebar window data.
Sidebar private Window data -.
Definition private.h:90
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sb_scroll_selection_to_row()

int sb_scroll_selection_to_row ( struct SidebarFunctionData * fdata,
int wanted_row )
static

Scroll the view so the selection is at a given row.

Parameters
fdataSidebar function data
wanted_rowRow at which the selection should appear (0 = top)
Return values
enumFunctionRetval

The current selection (highlight) is unchanged; only the view is moved.

Definition at line 806 of file functions_sidebar.c.

807{
808 struct SidebarWindowData *wdata = fdata->wdata;
809 if (!mutt_window_is_visible(wdata->win))
810 return FR_NO_ACTION;
811
812 if (ARRAY_EMPTY(&wdata->entries) || (wdata->hil_index < 0))
813 return FR_NO_ACTION;
814
815 const int new_top = sb_index_visible_before(wdata, wdata->hil_index, wanted_row);
816 if (new_top == wdata->top_index)
817 return FR_NO_ACTION;
818
819 wdata->top_index = new_top;
820 wdata->win->actions |= WA_RECALC;
821 return FR_SUCCESS;
822}
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ OpSidebar

const struct MenuFuncOp OpSidebar[]
static
Initial value:
= {
{ "sidebar-first", OP_SIDEBAR_FIRST },
{ "sidebar-last", OP_SIDEBAR_LAST },
{ "sidebar-next", OP_SIDEBAR_NEXT },
{ "sidebar-next-new", OP_SIDEBAR_NEXT_NEW },
{ "sidebar-open", OP_SIDEBAR_OPEN },
{ "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN },
{ "sidebar-page-up", OP_SIDEBAR_PAGE_UP },
{ "sidebar-prev", OP_SIDEBAR_PREV },
{ "sidebar-prev-new", OP_SIDEBAR_PREV_NEW },
{ "sidebar-scroll-half-down", OP_SIDEBAR_SCROLL_HALF_DOWN },
{ "sidebar-scroll-half-up", OP_SIDEBAR_SCROLL_HALF_UP },
{ "sidebar-scroll-line-down", OP_SIDEBAR_SCROLL_LINE_DOWN },
{ "sidebar-scroll-line-up", OP_SIDEBAR_SCROLL_LINE_UP },
{ "sidebar-scroll-selection-to-bottom", OP_SIDEBAR_SCROLL_SELECTION_TO_BOTTOM },
{ "sidebar-scroll-selection-to-middle", OP_SIDEBAR_SCROLL_SELECTION_TO_MIDDLE },
{ "sidebar-scroll-selection-to-top", OP_SIDEBAR_SCROLL_SELECTION_TO_TOP },
{ "sidebar-select-entry-by-number", OP_SIDEBAR_SELECT_ENTRY_BY_NUMBER },
{ "sidebar-select-page-bottom", OP_SIDEBAR_SELECT_PAGE_BOTTOM },
{ "sidebar-select-page-middle", OP_SIDEBAR_SELECT_PAGE_MIDDLE },
{ "sidebar-select-page-top", OP_SIDEBAR_SELECT_PAGE_TOP },
{ "sidebar-start-search", OP_SIDEBAR_START_SEARCH },
{ "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL },
{ "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE },
{ NULL, 0 },
}

Functions for the Sidebar Window.

Definition at line 52 of file functions_sidebar.c.

52 { /* map: sidebar */
53 { "sidebar-first", OP_SIDEBAR_FIRST },
54 { "sidebar-last", OP_SIDEBAR_LAST },
55 { "sidebar-next", OP_SIDEBAR_NEXT },
56 { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW },
57 { "sidebar-open", OP_SIDEBAR_OPEN },
58 { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN },
59 { "sidebar-page-up", OP_SIDEBAR_PAGE_UP },
60 { "sidebar-prev", OP_SIDEBAR_PREV },
61 { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW },
62 { "sidebar-scroll-half-down", OP_SIDEBAR_SCROLL_HALF_DOWN },
63 { "sidebar-scroll-half-up", OP_SIDEBAR_SCROLL_HALF_UP },
64 { "sidebar-scroll-line-down", OP_SIDEBAR_SCROLL_LINE_DOWN },
65 { "sidebar-scroll-line-up", OP_SIDEBAR_SCROLL_LINE_UP },
66 { "sidebar-scroll-selection-to-bottom", OP_SIDEBAR_SCROLL_SELECTION_TO_BOTTOM },
67 { "sidebar-scroll-selection-to-middle", OP_SIDEBAR_SCROLL_SELECTION_TO_MIDDLE },
68 { "sidebar-scroll-selection-to-top", OP_SIDEBAR_SCROLL_SELECTION_TO_TOP },
69 { "sidebar-select-entry-by-number", OP_SIDEBAR_SELECT_ENTRY_BY_NUMBER },
70 { "sidebar-select-page-bottom", OP_SIDEBAR_SELECT_PAGE_BOTTOM },
71 { "sidebar-select-page-middle", OP_SIDEBAR_SELECT_PAGE_MIDDLE },
72 { "sidebar-select-page-top", OP_SIDEBAR_SELECT_PAGE_TOP },
73 { "sidebar-start-search", OP_SIDEBAR_START_SEARCH },
74 { "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL },
75 { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE },
76 { NULL, 0 },
77};

◆ SidebarDefaultBindings

const struct MenuOpSeq SidebarDefaultBindings[]
Initial value:
= {
{ 0, NULL },
}

Key bindings for the Sidebar Window.

Definition at line 82 of file functions_sidebar.c.

82 { /* map: sidebar */
83 { 0, NULL },
84};

◆ SidebarFunctions

const struct SidebarFunction SidebarFunctions[]
static
Initial value:
= {
{ OP_SIDEBAR_FIRST, op_sidebar_first },
{ OP_SIDEBAR_LAST, op_sidebar_last },
{ OP_SIDEBAR_NEXT, op_sidebar_next },
{ OP_SIDEBAR_NEXT_NEW, op_sidebar_next_new },
{ OP_SIDEBAR_OPEN, op_sidebar_open },
{ OP_SIDEBAR_PAGE_DOWN, op_sidebar_scroll_page_down },
{ OP_SIDEBAR_PAGE_UP, op_sidebar_scroll_page_up },
{ OP_SIDEBAR_PREV, op_sidebar_prev },
{ OP_SIDEBAR_PREV_NEW, op_sidebar_prev_new },
{ OP_SIDEBAR_SCROLL_HALF_DOWN, op_sidebar_scroll_half_down },
{ OP_SIDEBAR_SCROLL_HALF_UP, op_sidebar_scroll_half_up },
{ OP_SIDEBAR_SCROLL_LINE_DOWN, op_sidebar_scroll_line_down },
{ OP_SIDEBAR_SCROLL_LINE_UP, op_sidebar_scroll_line_up },
{ OP_SIDEBAR_SCROLL_SELECTION_TO_BOTTOM, op_sidebar_scroll_selection_to_bottom },
{ OP_SIDEBAR_SCROLL_SELECTION_TO_MIDDLE, op_sidebar_scroll_selection_to_middle },
{ OP_SIDEBAR_SCROLL_SELECTION_TO_TOP, op_sidebar_scroll_selection_to_top },
{ OP_SIDEBAR_SELECT_ENTRY_BY_NUMBER, op_sidebar_select_entry_by_number },
{ OP_SIDEBAR_SELECT_PAGE_BOTTOM, op_sidebar_select_page_bottom },
{ OP_SIDEBAR_SELECT_PAGE_MIDDLE, op_sidebar_select_page_middle },
{ OP_SIDEBAR_SELECT_PAGE_TOP, op_sidebar_select_page_top },
{ OP_SIDEBAR_START_SEARCH, op_sidebar_start_search },
{ OP_SIDEBAR_TOGGLE_VIRTUAL, op_sidebar_toggle_virtual },
{ OP_SIDEBAR_TOGGLE_VISIBLE, op_sidebar_toggle_visible },
{ 0, NULL },
}
int op_sidebar_start_search(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the last unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_scroll_selection_to_middle(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls so the selection is at the middle of the screen - Implements sidebar_function_t -.
int op_sidebar_open(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Open highlighted mailbox - Implements sidebar_function_t -.
static int op_sidebar_scroll_selection_to_bottom(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls so the selection is at the bottom of the screen - Implements sidebar_function_t -.
static int op_sidebar_scroll_half_up(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls up by half a page - Implements sidebar_function_t -.
static int op_sidebar_select_page_middle(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the entry at the middle of the visible page - Implements sidebar_function_t -.
int op_sidebar_prev(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the previous unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_toggle_visible(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Make the sidebar (in)visible - Implements sidebar_function_t -.
int op_sidebar_scroll_page_down(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls down by one page - Implements sidebar_function_t -.
static int op_sidebar_toggle_virtual(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Deprecated - Implements sidebar_function_t -.
static int op_sidebar_select_page_top(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the entry at the top of the visible page - Implements sidebar_function_t -.
int op_sidebar_next(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the next unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_scroll_line_down(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls down by one line - Implements sidebar_function_t -.
int op_sidebar_first(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the first unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_scroll_line_up(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls up by one line - Implements sidebar_function_t -.
int op_sidebar_scroll_page_up(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls up by one page - Implements sidebar_function_t -.
static int op_sidebar_scroll_selection_to_top(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls so the selection is at the top of the screen - Implements sidebar_function_t -.
static int op_sidebar_scroll_half_down(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Scrolls down by half a page - Implements sidebar_function_t -.
static int op_sidebar_next_new(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the next new mailbox - Implements sidebar_function_t -.
static int op_sidebar_prev_new(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the previous new mailbox - Implements sidebar_function_t -.
static int op_sidebar_select_page_bottom(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the entry at the bottom of the visible page - Implements sidebar_function_t -.
int op_sidebar_last(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Selects the last unhidden mailbox - Implements sidebar_function_t -.
static int op_sidebar_select_entry_by_number(struct SidebarFunctionData *fdata, const struct KeyEvent *event)
Jump to a specific mailbox - Implements sidebar_function_t -.

All the NeoMutt functions that the Sidebar supports.

Definition at line 876 of file functions_sidebar.c.

876 {
877 // clang-format off
878 { OP_SIDEBAR_FIRST, op_sidebar_first },
879 { OP_SIDEBAR_LAST, op_sidebar_last },
880 { OP_SIDEBAR_NEXT, op_sidebar_next },
881 { OP_SIDEBAR_NEXT_NEW, op_sidebar_next_new },
882 { OP_SIDEBAR_OPEN, op_sidebar_open },
883 { OP_SIDEBAR_PAGE_DOWN, op_sidebar_scroll_page_down },
884 { OP_SIDEBAR_PAGE_UP, op_sidebar_scroll_page_up },
885 { OP_SIDEBAR_PREV, op_sidebar_prev },
886 { OP_SIDEBAR_PREV_NEW, op_sidebar_prev_new },
887 { OP_SIDEBAR_SCROLL_HALF_DOWN, op_sidebar_scroll_half_down },
888 { OP_SIDEBAR_SCROLL_HALF_UP, op_sidebar_scroll_half_up },
889 { OP_SIDEBAR_SCROLL_LINE_DOWN, op_sidebar_scroll_line_down },
890 { OP_SIDEBAR_SCROLL_LINE_UP, op_sidebar_scroll_line_up },
891 { OP_SIDEBAR_SCROLL_SELECTION_TO_BOTTOM, op_sidebar_scroll_selection_to_bottom },
892 { OP_SIDEBAR_SCROLL_SELECTION_TO_MIDDLE, op_sidebar_scroll_selection_to_middle },
893 { OP_SIDEBAR_SCROLL_SELECTION_TO_TOP, op_sidebar_scroll_selection_to_top },
894 { OP_SIDEBAR_SELECT_ENTRY_BY_NUMBER, op_sidebar_select_entry_by_number },
895 { OP_SIDEBAR_SELECT_PAGE_BOTTOM, op_sidebar_select_page_bottom },
896 { OP_SIDEBAR_SELECT_PAGE_MIDDLE, op_sidebar_select_page_middle },
897 { OP_SIDEBAR_SELECT_PAGE_TOP, op_sidebar_select_page_top },
898 { OP_SIDEBAR_START_SEARCH, op_sidebar_start_search },
899 { OP_SIDEBAR_TOGGLE_VIRTUAL, op_sidebar_toggle_virtual },
900 { OP_SIDEBAR_TOGGLE_VISIBLE, op_sidebar_toggle_visible },
901 { 0, NULL },
902 // clang-format on
903};