diff --git a/utils/newparser/handle_tags.c b/utils/newparser/handle_tags.c index 3e49960686..a725a52396 100644 --- a/utils/newparser/handle_tags.c +++ b/utils/newparser/handle_tags.c @@ -123,7 +123,22 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line) int counter; while (element) { - if (element->type == LINE) + if (element->type == VIEWPORT) + { + struct skin_element *next; + /* parse the viewport */ + /* if the next element is a LINE we need to set it to eat the line ending */ + next = element->children[0]; + if (element->tag && next->type == LINE && + element->line == next->line) + { + struct line *line = (struct line*)malloc(sizeof(struct line)); + line->update_mode = 0; + line->eat_line_ending = true; + next->data = line; + } + } + else if (element->type == LINE && !element->data) { struct line *line = (struct line*)malloc(sizeof(struct line)); line->update_mode = 0; @@ -164,6 +179,7 @@ int handle_tree(struct skin *skin, struct skin_element* tree, struct line *line) int ret = handle_tree(skin, element->children[counter], current_line); counter++; } + /* *probably* set current_line to NULL here */ element = element->next; } return 0; diff --git a/utils/newparser/skin_render.c b/utils/newparser/skin_render.c index dfcc4b89ea..f39e6f6c45 100644 --- a/utils/newparser/skin_render.c +++ b/utils/newparser/skin_render.c @@ -111,7 +111,7 @@ void skin_render_viewport(struct skin_element* viewport, bool draw_tags) func(line, linebuf, sizeof(linebuf), line_number); if (draw_tags) { - printf("%s", linebuf); + printf("[%d]%s", line_number, linebuf); if (!((struct line*)line->data)->eat_line_ending) { printf("\n");