X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fviewer.c;h=c23dc4079182452c7e21bdb956058e0bea0f6e9f;hb=d697dc5138fe93ed9d0316ddf41de6c12b05683d;hp=ea335844d108d021f849a8aa90693c9a1bdc5d5a;hpb=37640d707f7f7a1fd864d8f22baa8ada756c7984;p=smdp.git diff --git a/src/viewer.c b/src/viewer.c index ea33584..c23dc40 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) 2015 Michael Goehler + * Copyright (C) 2016 Michael Goehler * * This file is part of mdp. * @@ -510,16 +510,25 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert, int reloa void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols, int colors) { - if(!line->text->value) { - return; - } - int i; // increment int offset = 0; // text offset // move the cursor in position wmove(window, y, x); + if(!line->text->value) { + + // fill rest off line with spaces if we are in a code block + if(CHECK_BIT(line->bits, IS_CODE) && colors) { + wattron(window, COLOR_PAIR(CP_BLACK)); + for(i = getcurx(window) - x; i < max_cols; i++) + wprintw(window, "%s", " "); + } + + // do nothing + return; + } + // IS_UNORDERED_LIST_3 if(CHECK_BIT(line->bits, IS_UNORDERED_LIST_3)) { offset = next_nonblank(line->text, 0);