fixed nested quotation
authorMichael Göhler <somebody.here@gmx.de>
Sun, 14 Sep 2014 10:31:56 +0000 (12:31 +0200)
committerMichael Göhler <somebody.here@gmx.de>
Sun, 14 Sep 2014 10:32:51 +0000 (12:32 +0200)
viewer.c

index 82d8d99..15b5e6a 100644 (file)
--- a/viewer.c
+++ b/viewer.c
@@ -308,12 +308,17 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols) {
 
                 // IS_QUOTE
                 if(CHECK_BIT(line->bits, IS_QUOTE)) {
-                    // print a reverse color block
-                    wattron(window, A_REVERSE);
-                    wprintw(window, "%s", " ");
-                    wattroff(window, A_REVERSE);
-                    wprintw(window, "%s", " ");
-                    offset += 2;
+                    while(line->text->text[offset] == '>') {
+                        // print a reverse color block
+                        wattron(window, A_REVERSE);
+                        wprintw(window, "%s", " ");
+                        wattroff(window, A_REVERSE);
+                        wprintw(window, "%s", " ");
+                        // find next quote or break
+                        offset++;
+                        if(line->text->text[offset] == ' ')
+                            offset = next_word(line->text, offset);
+                    }
                 }
 
                 // for each char in line