X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fviewer.c;h=b9dcbf72759572fa52fd94238793fa50a9462f06;hb=d2fc31c1f5458db55941c531d7270ae70979f864;hp=447d3fe79414216b8a3a64b2f77b1df8895131a9;hpb=fa37b3011e109c052dd441f7bd027bec3958815f;p=smdp.git diff --git a/src/viewer.c b/src/viewer.c index 447d3fe..b9dcbf7 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -266,6 +266,7 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) { "%d / %d", sc, deck->slides); // make header + fooder visible + wrefresh(content); wrefresh(stdscr); line = slide->line; @@ -573,7 +574,7 @@ void inline_display(WINDOW *window, const char *c, const int colors) { // closing special char (or second backslash) // only if not followed by :alnum: if((stack->top)(stack, *i) && - (!isalnum(*(i + 1)) || *(i + 1) == '\0' || *i == '\\')) { + (!isalnum((int)i[1]) || *(i + 1) == '\0' || *i == '\\')) { switch(*i) { // print escaped backslash @@ -611,10 +612,11 @@ void inline_display(WINDOW *window, const char *c, const int colors) { // emphasis or code span can start after new-line or space only // and of cause after another emphasis markup - if(*(i - 1) == ' ' || - ((*(i - 1) == '_' || *(i - 1) == '*') && (*(i - 2) == ' ' || (i - 1) == c)) || - *i == '\\' || - i == c) { + //TODO this condition looks ugly + if(i == c || + *(i - 1) == ' ' || + ((*(i - 1) == '_' || *(i - 1) == '*') && ((i - 1) == c || *(i - 2) == ' ')) || + *i == '\\') { switch(*i) { // enable highlight