From 17d3e3facb9cc8c5adf0fa9ab68f32be28f4ff72 Mon Sep 17 00:00:00 2001 From: Christopher John CZETTEL Date: Sun, 25 Sep 2016 14:48:14 +0200 Subject: [PATCH] Fixes repaint problem with $pager_index_lines #159 Commit 6b4c4ca changed the behaviour of mutt_pager to build the pager index even if pager_index_lines was set to 0 to (fixing #143). The code redrawing the pager status line was relying on the pager index being NULL to determine if a redraw should take place. Now index_window->rows is used as an additional safeguard. Also added a check if pager index is set to the terminal status line update code as it was unguarded and old default behaviour might be introduced later. Fixes #159 --- pager.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pager.c b/pager.c index ee8898470..6b863ca84 100644 --- a/pager.c +++ b/pager.c @@ -1958,7 +1958,11 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) mutt_draw_statusline (pager_status_window->cols, bn, sizeof (bn)); } NORMAL_COLOR; - if (option(OPTTSENABLED) && TSSupported) + + /* + * update terminal status line + */ + if (option(OPTTSENABLED) && TSSupported && index) { menu_status_line (buffer, sizeof (buffer), index, NONULL (TSStatusFormat)); mutt_ts_status(buffer); @@ -1967,12 +1971,11 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) } } - if ((redraw & REDRAW_INDEX) && index) + /* redraw the pager_index indicator, because the + * flags for this message might have changed. */ + if ((redraw & REDRAW_INDEX) && index && (index_window->rows > 0)) { - /* redraw the pager_index indicator, because the - * flags for this message might have changed. */ - if (index_window->rows > 0) - menu_redraw_current (index); + menu_redraw_current (index); /* print out the index status bar */ menu_status_line (buffer, sizeof (buffer), index, NONULL(Status)); -- 2.40.0