From: Kevin McCarthy Date: Sat, 30 Apr 2016 01:00:10 +0000 (-0700) Subject: Remove newline insertion from pager. (closes #3835) X-Git-Tag: neomutt-20160822~157 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66480916209aeb913614004770cb0cf032485c0b;p=neomutt Remove newline insertion from pager. (closes #3835) The window patches commited now manually move to the next line, so there is no need to insert newlines for that purpose. The newlines also goof windows placed to the right of the pager, as is the case for the (currently external) sidebar-on-the-right functionality. Thanks to Richard Russon for the original patch and help testing the revised patch. --- diff --git a/pager.c b/pager.c index 50e36b75c..fc8eabaf5 100644 --- a/pager.c +++ b/pager.c @@ -1502,18 +1502,12 @@ display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n, ATTRSET(def_color); } - /* ncurses always wraps lines when you get to the right side of the - * screen, but S-Lang seems to only wrap if the next character is *not* - * a newline (grr!). - */ -#ifndef USE_SLANG_CURSES - if (col < pager_window->cols) -#endif - addch ('\n'); + if (col < pager_window->cols) + mutt_window_clrtoeol (pager_window); /* * reset the color back to normal. This *must* come after the - * addch('\n'), otherwise the color for this line will not be + * clrtoeol, otherwise the color for this line will not be * filled to the right margin. */ if (flags & M_SHOWCOLOR) @@ -1814,7 +1808,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) mutt_window_clrtoeol (pager_window); if (option (OPTTILDE)) addch ('~'); - addch ('\n'); lines++; mutt_window_move (pager_window, lines, 0); }