]> granicus.if.org Git - neomutt/commitdiff
Remove newline insertion from pager. (closes #3835)
authorKevin McCarthy <kevin@8t8.us>
Sat, 30 Apr 2016 01:00:10 +0000 (18:00 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sat, 30 Apr 2016 01:00:10 +0000 (18:00 -0700)
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.

pager.c

diff --git a/pager.c b/pager.c
index 50e36b75c624543b15eaf78132844d0fe880023c..fc8eabaf526dd7ab2e2ee7dd27a69d0a9f8d3a1b 100644 (file)
--- 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);
       }