X-Git-Url: https://git.danieliu.xyz/?p=smdp.git;a=blobdiff_plain;f=src%2Fviewer.c;h=97e62df7f9114dc354502df634c5f9a0ae66fcd3;hp=5ca04a5c3706c28b1ef13feb3ea76f8a108e9d2f;hb=51b2a847fc5798c5b0f56ae93f6e1355038df840;hpb=9adad15f5201cd5e78dcde688ceb6d7b56e0fffb 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)