From: Michael Göhler Date: Wed, 25 Mar 2015 23:59:26 +0000 (+0100) Subject: remove unnecessary blanks at the output X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=51b2a847fc5798c5b0f56ae93f6e1355038df840;p=smdp.git remove unnecessary blanks at the output --- diff --git a/src/viewer.c b/src/viewer.c index 5ca04a5..97e62df 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -633,8 +633,11 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colo } // fill rest off line with spaces - for(i = getcurx(window) - x; i < max_cols; i++) - wprintw(window, "%s", " "); + // we only need this if the color is inverted (e.g. code-blocks), + // to ensure the background fades too + if(CHECK_BIT(line->bits, IS_CODE)) + for(i = getcurx(window) - x; i < max_cols; i++) + wprintw(window, "%s", " "); // reset to default color if(colors)