remove unnecessary blanks at the output
authorMichael Göhler <somebody.here@gmx.de>
Wed, 25 Mar 2015 23:59:26 +0000 (00:59 +0100)
committerMichael Göhler <somebody.here@gmx.de>
Wed, 25 Mar 2015 23:59:26 +0000 (00:59 +0100)
src/viewer.c

index 5ca04a5..97e62df 100644 (file)
@@ -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
     }
 
     // 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)
 
     // reset to default color
     if(colors)