From d55e6f56f04d5fe2c9bec0ea8a0dc4bf5e7e6f2b Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Sun, 31 May 2009 12:40:37 +0200 Subject: [PATCH] Give $pager_context lines of context when searching page-based menus. Closes #976. --- ChangeLog | 23 +++++++++++++++++++++++ pager.c | 26 +++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e06d4086..ad933f6df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2009-05-31 11:32 +0200 Rocco Rutte (68ee7fe4aa49) + + * handler.c, init.h, rfc3676.c: f=f: Strip trailing spaces for + interoperability. Closes #3001. + + If we make a fixed reply to a flowed message we remove trailing + spaces and can now safely allow $indent_string to be used which is + what users expect. + + Second, if we make a flowed reply to a fixed message we also strip + trailing spaces since from format=fixed we assume all lines are + fixed (i.e. we don't want to errorneously make fixed lines flowed). + +2009-05-31 10:40 +0200 Rocco Rutte (03ea7644f71b) + + * ChangeLog, handler.c, init.h, mutt.h: Add $honor_disposition to not + display attachments inline. Closes #3170. + + Previously all MIME parts were displayed inline regardless of the + Content-Disposition header (if present). With $honor_disposition + set, only inline parts are displayed inline, attachments can only be + viewed from the attachments menu. + 2009-04-25 01:56 -0400 Dan Loewenherz (c1b947f60ea6) * init.h: Disables the insecure SSLv2 protocol. Closes #3192. diff --git a/pager.c b/pager.c index 0521c7671..8ddba66d4 100644 --- a/pager.c +++ b/pager.c @@ -1531,7 +1531,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) struct q_class_t *QuoteList = NULL; int i, j, ch = 0, rc = -1, hideQuoted = 0, q_level = 0, force_redraw = 0; int lines = 0, curline = 0, topline = 0, oldtopline = 0, err, first = 1; - int r = -1, wrapped = 0; + int r = -1, wrapped = 0, searchctx = 0; int redraw = REDRAW_FULL; FILE *fp = NULL; LOFF_T last_pos = 0, last_offset = 0; @@ -1988,12 +1988,17 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) { wrapped = 0; + if (PagerContext > 0 && PagerContext < LINES - 2 - option (OPTHELP) ? 1 : 0) + searchctx = PagerContext; + else + searchctx = 0; + search_next: if ((!SearchBack && ch==OP_SEARCH_NEXT) || (SearchBack &&ch==OP_SEARCH_OPPOSITE)) { /* searching forward */ - for (i = wrapped ? 0 : topline + 1; i < lastLine; i++) + for (i = wrapped ? 0 : topline + searchctx + 1; i < lastLine; i++) { if ((!hideQuoted || lineInfo[i].type != MT_COLOR_QUOTED) && !lineInfo[i].continuation && lineInfo[i].search_cnt > 0) @@ -2014,7 +2019,7 @@ search_next: else { /* searching backward */ - for (i = wrapped ? lastLine : topline - 1; i >= 0; i--) + for (i = wrapped ? lastLine : topline + searchctx - 1; i >= 0; i--) { if ((!hideQuoted || (has_types && lineInfo[i].type != MT_COLOR_QUOTED)) && @@ -2035,7 +2040,12 @@ search_next: } if (lineInfo[topline].search_cnt > 0) + { SearchFlag = M_SEARCH; + /* give some context for search results */ + if (topline - searchctx > 0) + topline -= searchctx; + } break; } @@ -2144,7 +2154,17 @@ search_next: mutt_error _("Not found."); } else + { SearchFlag = M_SEARCH; + /* give some context for search results */ + if (PagerContext > 0 && PagerContext < LINES - 2 - option (OPTHELP) ? 1 : 0) + searchctx = PagerContext; + else + searchctx = 0; + if (topline - searchctx > 0) + topline -= searchctx; + } + } redraw = REDRAW_BODY; break; -- 2.40.0