NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
pager.c
Go to the documentation of this file.
1
25
63
64#include "config.h"
65#include <stdbool.h>
66#include <stddef.h>
67#include <sys/stat.h>
68#include "mutt/lib.h"
69#include "config/lib.h"
70#include "core/lib.h"
71#include "gui/lib.h"
72#include "debug/lib.h"
73#include "lib.h"
74#include "color/lib.h"
75#include "hooks/lib.h"
76#include "index/lib.h"
77#include "key/lib.h"
78#include "display.h"
79#include "private_data.h"
80
87static int config_pager_index_lines(struct MuttWindow *win)
88{
89 if (!mutt_window_is_visible(win))
90 return 0;
91
92 struct MuttWindow *dlg = dialog_find(win);
93 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
94 struct MuttWindow *win_index = window_find_child(panel_index, WT_MENU);
95 if (!win_index)
96 return -1;
97
98 const short c_pager_index_lines = cs_subset_number(NeoMutt->sub, "pager_index_lines");
99
100 if (c_pager_index_lines > 0)
101 {
102 win_index->req_rows = c_pager_index_lines;
103 win_index->size = MUTT_WIN_SIZE_FIXED;
104
105 panel_index->size = MUTT_WIN_SIZE_MINIMISE;
106 panel_index->state.visible = true;
107 }
108 else
109 {
111 win_index->size = MUTT_WIN_SIZE_MAXIMISE;
112
113 panel_index->size = MUTT_WIN_SIZE_MAXIMISE;
114 panel_index->state.visible = false;
115 }
116
118 mutt_debug(LL_DEBUG5, "config, request WA_REFLOW\n");
119 return 0;
120}
121
125static int pager_recalc(struct MuttWindow *win)
126{
127 win->actions |= WA_REPAINT;
128 mutt_debug(LL_DEBUG5, "recalc done, request WA_REPAINT\n");
129 return 0;
130}
131
135static int pager_repaint(struct MuttWindow *win)
136{
137 struct PagerPrivateData *priv = win->wdata;
138 if (!priv || !priv->pview || !priv->pview->pdata)
139 return 0;
140
141 dump_pager(priv);
142
143 /* Phase 1: Reflow the content if the window was resized or needs repopulating.
144 * Reset all line metadata and re-display lines up to the current position. */
145 const bool repopulate = (priv->cur_line > priv->lines_used);
146 if ((priv->redraw & PAGER_REDRAW_FLOW) || repopulate)
147 {
148 priv->win_height = -1;
149 for (int i = 0; i <= priv->top_line; i++)
150 if (!priv->lines[i].cont_line)
151 priv->win_height++;
152 for (int i = 0; i < priv->lines_max; i++)
153 {
154 priv->lines[i].offset = 0;
155 priv->lines[i].cid = -1;
156 priv->lines[i].cont_line = false;
157 priv->lines[i].syntax_arr_size = 0;
158 priv->lines[i].search_arr_size = -1;
159 priv->lines[i].quote = NULL;
160
161 MUTT_MEM_REALLOC(&(priv->lines[i].syntax), 1, struct TextSyntax);
162 priv->lines[i].syntax[0].attr_color = NULL;
163 priv->lines[i].syntax[0].first = -1;
164 priv->lines[i].syntax[0].last = -1;
165
166 if (priv->search_compiled && priv->lines[i].search)
167 FREE(&(priv->lines[i].search));
168 }
169
170 if (!repopulate)
171 {
172 priv->lines_used = 0;
173 priv->top_line = 0;
174 }
175
176 int i = -1;
177 int j = -1;
178 const PagerFlags flags = priv->has_types | priv->search_flag |
179 (priv->pview->flags & MUTT_PAGER_NOWRAP) |
180 (priv->pview->flags & MUTT_PAGER_STRIPES);
181
182 while (display_line(priv->fp, &priv->bytes_read, &priv->lines, ++i,
183 &priv->lines_used, &priv->lines_max, flags, &priv->quote_list,
184 &priv->q_level, &priv->force_redraw, &priv->search_re,
185 priv->pview->win_pager, &priv->ansi_list) == 0)
186 {
187 if (!priv->lines[i].cont_line && (++j == priv->win_height))
188 {
189 if (!repopulate)
190 priv->top_line = i;
191 if (!priv->search_flag)
192 break;
193 }
194 }
195 }
196
197 /* Phase 2: Repaint visible lines from top_line downward. Repeatedly
198 * calls display_line() for each row in the pager window. */
199 if ((priv->redraw & PAGER_REDRAW_PAGER) || (priv->top_line != priv->old_top_line))
200 {
201 do
202 {
203 mutt_window_move(priv->pview->win_pager, 0, 0);
204 priv->cur_line = priv->top_line;
205 priv->old_top_line = priv->top_line;
206 priv->win_height = 0;
207 priv->force_redraw = false;
208
209 while ((priv->win_height < priv->pview->win_pager->state.rows) &&
210 (priv->lines[priv->cur_line].offset <= priv->st.st_size - 1))
211 {
212 const PagerFlags flags = (priv->pview->flags & MUTT_DISPLAYFLAGS) |
213 priv->hide_quoted | priv->search_flag |
214 (priv->pview->flags & MUTT_PAGER_NOWRAP) |
215 (priv->pview->flags & MUTT_PAGER_STRIPES);
216
217 if (display_line(priv->fp, &priv->bytes_read, &priv->lines, priv->cur_line,
218 &priv->lines_used, &priv->lines_max, flags, &priv->quote_list,
219 &priv->q_level, &priv->force_redraw, &priv->search_re,
220 priv->pview->win_pager, &priv->ansi_list) > 0)
221 {
222 priv->win_height++;
223 }
224 priv->cur_line++;
225 mutt_window_move(priv->pview->win_pager, priv->win_height, 0);
226 }
227 } while (priv->force_redraw);
228
229 /* Fill remaining rows with tilde characters (like vi) */
230 const bool c_tilde = cs_subset_bool(NeoMutt->sub, "tilde");
232 while (priv->win_height < priv->pview->win_pager->state.rows)
233 {
235 if (c_tilde)
236 mutt_window_addch(priv->pview->win_pager, '~');
237 priv->win_height++;
238 mutt_window_move(priv->pview->win_pager, priv->win_height, 0);
239 }
241 }
242
244 mutt_debug(LL_DEBUG5, "repaint done\n");
245 return 0;
246}
247
252{
253 if (nc->event_type != NT_COLOR)
254 return 0;
255 if (!nc->global_data || !nc->event_data)
256 return -1;
257
258 struct EventColor *ev_c = nc->event_data;
259 struct MuttWindow *win_pager = nc->global_data;
260 struct PagerPrivateData *priv = win_pager->wdata;
261 if (!priv)
262 return 0;
263
264 // MT_COLOR_MAX is sent on `uncolor *`
265 if (COLOR_QUOTED(ev_c->cid) || (ev_c->cid == MT_COLOR_MAX))
266 {
267 // rework quoted colours
269 }
270
271 if (ev_c->cid == MT_COLOR_MAX)
272 {
273 for (size_t i = 0; i < priv->lines_max; i++)
274 {
275 FREE(&(priv->lines[i].syntax));
276 }
277 priv->lines_used = 0;
278 }
279 else if ((ev_c->cid == MT_COLOR_ATTACHMENT) || (ev_c->cid == MT_COLOR_ATTACH_HEADERS) ||
280 (ev_c->cid == MT_COLOR_BODY) || (ev_c->cid == MT_COLOR_BOLD) ||
281 (ev_c->cid == MT_COLOR_ERROR) || (ev_c->cid == MT_COLOR_HDRDEFAULT) ||
282 (ev_c->cid == MT_COLOR_HEADER) || (ev_c->cid == MT_COLOR_ITALIC) ||
283 (ev_c->cid == MT_COLOR_MARKERS) || (ev_c->cid == MT_COLOR_MESSAGE) ||
284 (ev_c->cid == MT_COLOR_NORMAL) || (ev_c->cid == MT_COLOR_SEARCH) ||
285 (ev_c->cid == MT_COLOR_SIGNATURE) || (ev_c->cid == MT_COLOR_STRIPE_EVEN) ||
286 (ev_c->cid == MT_COLOR_STRIPE_ODD) || (ev_c->cid == MT_COLOR_TILDE) ||
287 (ev_c->cid == MT_COLOR_UNDERLINE) || (ev_c->cid == MT_COLOR_WARNING))
288 {
290 }
291
292 mutt_debug(LL_DEBUG5, "color done\n");
293 return 0;
294}
295
300{
301 if (nc->event_type != NT_CONFIG)
302 return 0;
303 if (!nc->global_data || !nc->event_data)
304 return -1;
305
306 struct MuttWindow *win_pager = nc->global_data;
308 // Either the Pager isn't visible, or isn't active
309 if (focus != win_pager)
310 return 0;
311
312 struct EventConfig *ev_c = nc->event_data;
313 if (mutt_str_equal(ev_c->name, "pager_index_lines"))
314 {
315 config_pager_index_lines(win_pager);
316 mutt_debug(LL_DEBUG5, "config done\n");
317 }
318 else if ((mutt_str_equal(ev_c->name, "allow_ansi")) ||
319 (mutt_str_equal(ev_c->name, "markers")) ||
320 (mutt_str_equal(ev_c->name, "smart_wrap")) ||
321 (mutt_str_equal(ev_c->name, "smileys")) ||
322 (mutt_str_equal(ev_c->name, "tilde")) ||
323 (mutt_str_equal(ev_c->name, "toggle_quoted_show_levels")) ||
324 (mutt_str_equal(ev_c->name, "wrap")))
325 {
326 struct PagerPrivateData *priv = win_pager->parent->wdata;
327 if (!priv)
328 return -1;
329
331 }
332 else if (mutt_str_equal(ev_c->name, "pager"))
333 {
334 const char *const c_pager = pager_get_pager(NeoMutt->sub);
335 if (c_pager)
336 {
337 // A message-hook has set $pager
338 // Close the Pager and let the Index handle the message
339 struct PagerPrivateData *priv = win_pager->parent->wdata;
340 priv->loop = PAGER_LOOP_QUIT;
341 mutt_push_macro_event(0, OP_DISPLAY_MESSAGE);
342 }
343 }
344
345 return 0;
346}
347
352{
353 if (nc->event_type != NT_INDEX)
354 return 0;
355 if (!nc->global_data)
356 return -1;
357
358 struct MuttWindow *win_pager = nc->global_data;
359
360 struct PagerPrivateData *priv = win_pager->wdata;
361 if (!priv)
362 return 0;
363
364 struct IndexSharedData *shared = nc->event_data;
365
367 {
368 win_pager->actions |= WA_RECALC;
369 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
370 priv->loop = PAGER_LOOP_QUIT;
371 }
372 else if (nc->event_subtype & NT_INDEX_EMAIL)
373 {
374 win_pager->actions |= WA_RECALC;
375 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
376 priv->pager_redraw = true;
377 if (shared && shared->email && (priv->loop != PAGER_LOOP_QUIT))
378 {
379 priv->loop = PAGER_LOOP_RELOAD;
381 }
382 else
383 {
384 priv->loop = PAGER_LOOP_QUIT;
385 priv->rc = 0;
386 }
387 }
388
389 return 0;
390}
391
396{
397 if (nc->event_type != NT_PAGER)
398 return 0;
399 if (!nc->global_data || !nc->event_data)
400 return -1;
401
402 struct MuttWindow *win_pager = nc->global_data;
403
404 struct PagerPrivateData *priv = win_pager->wdata;
405 if (!priv)
406 return 0;
407
409 mutt_debug(LL_DEBUG5, "pager done\n");
410 return 0;
411}
412
417{
418 if (nc->event_type != NT_WINDOW)
419 return 0;
420 if (!nc->global_data || !nc->event_data)
421 return -1;
423 return 0;
424
425 struct MuttWindow *win_pager = nc->global_data;
426 struct EventWindow *ev_w = nc->event_data;
427 if (ev_w->win != win_pager)
428 return 0;
429
430 struct PagerPrivateData *priv = win_pager->wdata;
431 if (!priv)
432 return 0;
433
434 struct MuttWindow *dlg = window_find_parent(win_pager, WT_DLG_INDEX);
435 if (!dlg)
436 dlg = window_find_parent(win_pager, WT_DLG_PAGER);
437
438 struct IndexSharedData *shared = dlg->wdata;
439
445
446 mutt_debug(LL_DEBUG5, "window delete done\n");
447
448 return 0;
449}
450
Color and attribute parsing.
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
Definition notify.c:73
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
Definition notify.c:62
@ MT_COLOR_MARKERS
Pager: markers, line continuation.
Definition color.h:51
@ MT_COLOR_MESSAGE
Informational message.
Definition color.h:52
@ MT_COLOR_MAX
Definition color.h:97
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition color.h:48
@ MT_COLOR_STRIPE_EVEN
Stripes: even lines of the Help Page.
Definition color.h:79
@ MT_COLOR_ERROR
Error message.
Definition color.h:46
@ MT_COLOR_BOLD
Bold text.
Definition color.h:40
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition color.h:39
@ MT_COLOR_HDRDEFAULT
Header default colour.
Definition color.h:47
@ MT_COLOR_NORMAL
Plain text.
Definition color.h:53
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition color.h:38
@ MT_COLOR_SEARCH
Pager: search matches.
Definition color.h:67
@ MT_COLOR_ITALIC
Italic text.
Definition color.h:50
@ MT_COLOR_STRIPE_ODD
Stripes: odd lines of the Help Page.
Definition color.h:80
@ MT_COLOR_ATTACHMENT
MIME attachments text (entire line)
Definition color.h:37
@ MT_COLOR_WARNING
Warning messages.
Definition color.h:84
@ MT_COLOR_UNDERLINE
Underlined text.
Definition color.h:83
@ MT_COLOR_SIGNATURE
Pager: signature lines.
Definition color.h:77
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition color.h:81
@ CMD_MESSAGE_HOOK
:message-hook
Definition command.h:97
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition helpers.c:143
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
Convenience wrapper for the debug headers.
void dump_pager(struct PagerPrivateData *priv)
Dump pager state.
Definition pager.c:146
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
int display_line(FILE *fp, LOFF_T *bytes_read, struct Line **lines, int line_num, int *lines_used, int *lines_max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager, struct AttrColorList *ansi_list)
Print a line on screen.
Definition display.c:1058
Pager Display.
void pager_queue_redraw(struct PagerPrivateData *priv, PagerRedrawFlags redraw)
Queue a request for a redraw.
Definition dlg_pager.c:121
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition get.c:173
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
static int pager_pager_observer(struct NotifyCallback *nc)
Notification that the Pager has changed - Implements observer_t -.
Definition pager.c:395
static int pager_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition pager.c:251
static int pager_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition pager.c:299
static int pager_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition pager.c:351
static int pager_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition pager.c:416
static int pager_recalc(struct MuttWindow *win)
Recalculate the Pager display - Implements MuttWindow::recalc() -.
Definition pager.c:125
static int pager_repaint(struct MuttWindow *win)
Repaint the Pager display - Implements MuttWindow::repaint() -.
Definition pager.c:135
Convenience wrapper for the gui headers.
void exec_message_hook(struct Mailbox *m, struct Email *e, enum CommandId id)
Perform a message hook.
Definition exec.c:137
Hook Commands.
GUI manage the main index (list of emails)
@ NT_INDEX_MAILBOX
Mailbox has changed.
Definition lib.h:80
@ NT_INDEX_EMAIL
Email has changed.
Definition lib.h:81
Manage keymappings.
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_REALLOC(pptr, n, type)
Definition memory.h:55
Convenience wrapper for the library headers.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition notify.c:191
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition notify.c:173
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
const struct AttrColor * mutt_curses_set_normal_backed_color_by_id(enum ColorId cid)
Set the colour and attributes by the Colour ID.
Definition mutt_curses.c:63
const struct AttrColor * mutt_curses_set_color_by_id(enum ColorId cid)
Set the colour and attributes by the Colour ID.
Definition mutt_curses.c:79
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.
struct MuttWindow * window_find_parent(struct MuttWindow *win, enum WindowType type)
Find a (grand-)parent of a Window by type.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
struct MuttWindow * window_get_focus(void)
Get the currently focused Window.
int mutt_window_move(struct MuttWindow *win, int row, int col)
Move the cursor in a Window.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
void mutt_window_clrtoeol(struct MuttWindow *win)
Clear to the end of the line.
int mutt_window_addch(struct MuttWindow *win, int ch)
Write one character to a Window.
@ WT_CUSTOM
Window with a custom drawing function.
Definition mutt_window.h:95
@ WT_DLG_INDEX
Index Dialog, dlg_index()
Definition mutt_window.h:86
@ WT_INDEX
A panel containing the Index Window.
Definition mutt_window.h:97
@ WT_DLG_PAGER
Pager Dialog, dlg_pager()
Definition mutt_window.h:84
@ WT_MENU
An Window containing a Menu.
Definition mutt_window.h:98
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition mutt_window.h:38
@ WA_REPAINT
Redraw the contents of the Window.
@ WA_RECALC
Recalculate the contents of the Window.
@ NT_WINDOW_DELETE
Window is about to be deleted.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition mutt_window.h:52
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition mutt_window.h:47
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
Definition mutt_window.h:49
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition mutt_window.h:48
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition notify_type.h:58
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition notify_type.h:43
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition notify_type.h:41
@ NT_PAGER
Pager data has changed, NotifyPager, PagerPrivateData.
Definition notify_type.h:54
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition notify_type.h:48
const char * pager_get_pager(struct ConfigSubset *sub)
Get the value of $pager.
Definition config.c:111
GUI display a file/email/help in a viewport with paging.
@ NT_PAGER_VIEW
Pager View has changed.
Definition lib.h:192
@ PAGER_LOOP_RELOAD
Reload the Pager from scratch.
Definition lib.h:155
@ PAGER_LOOP_QUIT
Quit the Pager.
Definition lib.h:154
@ PAGER_REDRAW_FLOW
Reflow the pager.
Definition lib.h:203
@ PAGER_REDRAW_PAGER
Redraw the pager.
Definition lib.h:202
@ PAGER_REDRAW_NONE
No flags are set.
Definition lib.h:201
#define MUTT_PAGER_NOWRAP
Format for term width, ignore $wrap.
Definition lib.h:74
#define MUTT_DISPLAYFLAGS
Definition lib.h:80
uint16_t PagerFlags
Flags for dlg_pager(), e.g. MUTT_SHOWFLAT.
Definition lib.h:62
#define MUTT_PAGER_STRIPES
Striped highlighting.
Definition lib.h:77
static int config_pager_index_lines(struct MuttWindow *win)
React to changes to $pager_index_lines.
Definition pager.c:87
struct MuttWindow * pager_window_new(struct IndexSharedData *shared, struct PagerPrivateData *priv)
Create a new Pager Window (list of Emails)
Definition pager.c:457
Private state data for the Pager.
void qstyle_recolor(struct QuoteStyle *quote_list)
Recolour quotes after colour changes.
Definition qstyle.c:464
#define COLOR_QUOTED(cid)
Definition quoted.h:28
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition subset.h:51
An Event that happened to a Colour.
Definition notify2.h:52
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:53
A config-change event.
Definition subset.h:70
const char * name
Name of config item that changed.
Definition subset.h:72
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct Email * email
Currently selected Email.
Definition shared_data.h:42
struct Mailbox * mailbox
Current Mailbox.
Definition shared_data.h:41
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition shared_data.h:44
short search_arr_size
Number of items in search array.
Definition display.h:59
struct TextSyntax * search
Array of search text in the line.
Definition display.h:60
bool cont_line
Continuation of a previous line (wrapped by NeoMutt)
Definition display.h:53
short cid
Default line colour, e.g. MT_COLOR_SIGNATURE.
Definition display.h:52
struct QuoteStyle * quote
Quoting style for this line (pointer into PagerPrivateData->quote_list)
Definition display.h:62
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
Definition display.h:51
short syntax_arr_size
Number of items in syntax array.
Definition display.h:56
struct TextSyntax * syntax
Array of coloured text in the line.
Definition display.h:57
int(* repaint)(struct MuttWindow *win)
struct WindowState state
Current state of the Window.
struct MuttWindow * focus
Focused Window.
void * wdata
Private data.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
short req_rows
Number of rows required.
int(* recalc)(struct MuttWindow *win)
struct MuttWindow * parent
Parent Window.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
Data passed to a notification function.
Definition observer.h:34
void * event_data
Data from notify_send()
Definition observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition observer.h:37
void * global_data
Data from notify_observer_add()
Definition observer.h:39
Private state data for the Pager.
PagerFlags hide_quoted
Set to MUTT_HIDE when quoted email is hidden <toggle-quoted>
int rc
Return code from functions.
int q_level
Number of unique quoting levels.
int cur_line
Current line (last line visible on screen)
bool pager_redraw
Force a complete redraw.
int lines_used
Size of lines array (used entries)
int lines_max
Capacity of lines array (total entries)
bool force_redraw
Repaint is needed.
enum PagerLoopMode loop
What the Event Loop should do next, e.g. PAGER_LOOP_CONTINUE.
struct Line * lines
Array of text lines in pager.
PagerRedrawFlags redraw
When to redraw the screen.
int has_types
Set to MUTT_TYPES for PAGER_MODE_EMAIL or MUTT_SHOWCOLOR.
struct Notify * notify
Notifications: NotifyPager, PagerPrivateData.
LOFF_T bytes_read
Number of bytes read from file.
int top_line
First visible line on screen.
struct stat st
Stats about Email file.
struct QuoteStyle * quote_list
Tree of quoting levels.
struct PagerView * pview
Object to view in the pager.
struct AttrColorList ansi_list
List of ANSI colours used in the Pager.
regex_t search_re
Compiled search string.
int win_height
Number of lines in the Window.
int old_top_line
Old top line, used for repainting.
FILE * fp
File containing decrypted/decoded/weeded Email.
PagerFlags search_flag
Set to MUTT_SEARCH when search results are visible <search-toggle>
bool search_compiled
Search regex is in use.
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition lib.h:174
PagerFlags flags
Additional settings to tweak pager's function.
Definition lib.h:176
struct MuttWindow * win_pager
Pager Window.
Definition lib.h:181
Highlighting for a piece of text.
Definition display.h:39
const struct AttrColor * attr_color
Curses colour of text.
Definition display.h:40
int last
Last character in line to be coloured (not included)
Definition display.h:42
int first
First character in line to be coloured.
Definition display.h:41
bool visible
Window is visible.
Definition mutt_window.h:59
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition mutt_window.h:61