X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fviewer.c;h=1b2e6b9bf5ced4e6d5905c4fae06d69d5e92268d;hb=2dcbfd8e30e5fe7109600349ebb2438223b12736;hp=5ca04a5c3706c28b1ef13feb3ea76f8a108e9d2f;hpb=80d361502cd01220458e3961dd380f6a26ea682a;p=smdp.git diff --git a/src/viewer.c b/src/viewer.c index 5ca04a5..1b2e6b9 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -2,7 +2,7 @@ * Functions necessary to display a deck of slides in different color modes * using ncurses. Only white, red, and blue are supported, as they can be * faded in 256 color mode. - * Copyright (C) 2014 Michael Goehler + * Copyright (C) 2015 Michael Goehler * * This file is part of mdp. * @@ -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) @@ -710,7 +713,7 @@ void inline_display(WINDOW *window, const wchar_t *c, const int colors) { if (*i == L'!') i++; - if (wcschr(i, L']')[1] == L'(') { + if (wcschr(i, L']')[1] == L'(' && wcschr(i, L')')) { i++; // turn higlighting and underlining on