summaryrefslogtreecommitdiffstats
path: root/mutt_curses.h
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-04-27 17:56:55 -0700
committerKevin McCarthy <kevin@8t8.us>2016-04-27 17:56:55 -0700
commit746bc982497eee813400d7aa08f838d133486186 (patch)
tree2847bdf54331c1eac5deec0555c1ec46048229ea /mutt_curses.h
parentf6aa2e790ef51060240999e8f1ebde9933f50eb8 (diff)
Modify the pager to use windows.
The pager view is somewhat complex, due to the "mini-index" and the positioning of the index_status vs pager_status changes depending on $status_on_top as well as $pager_index_lines and $help. To make things simpler, it creates four "pager windows": index_status_window, index_window, pager_status_window, pager_window. mutt_term_width() is renamed to mutt_window_wrap_cols() and a mutt_window_t parameter passed in. Also, the pager drawing loop calling display_line() has a mutt_window_move() added to move to the beginning of the next line each time. This is in case the pager_window isn't flush with the left side of the terminal.
Diffstat (limited to 'mutt_curses.h')
-rw-r--r--mutt_curses.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/mutt_curses.h b/mutt_curses.h
index 2d2fb280..1156c4ac 100644
--- a/mutt_curses.h
+++ b/mutt_curses.h
@@ -189,14 +189,14 @@ void mutt_window_clearline (mutt_window_t *, int row);
void mutt_window_getyx (mutt_window_t *, int *y, int *x);
-static inline int mutt_term_width(short wrap)
+static inline int mutt_window_wrap_cols(mutt_window_t *win, short wrap)
{
if (wrap < 0)
- return COLS > -wrap ? COLS + wrap : COLS;
+ return win->cols > -wrap ? win->cols + wrap : win->cols;
else if (wrap)
- return wrap < COLS ? wrap : COLS;
+ return wrap < win->cols ? wrap : win->cols;
else
- return COLS;
+ return win->cols;
}
extern int *ColorQuote;