From ae4c54bdccca5ddd883200d0079d28b1f11d8f44 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 5 May 2013 03:22:48 +0100 Subject: [PATCH] Include time in ddg search result output lines --- src/ui/core.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ui/core.c b/src/ui/core.c index eb592a8c..8e38ebbb 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -764,12 +764,25 @@ void ui_duck_result(const char * const result) { int win_index = _find_prof_win_index("DuckDuckGo search"); + if (win_index != NUM_WINS) { win_print_time(windows[win_index], '-'); wattron(windows[win_index]->win, COLOUR_THEM); wprintw(windows[win_index]->win, "Result : "); wattroff(windows[win_index]->win, COLOUR_THEM); - wprintw(windows[win_index]->win, result); + + int i = 0; + while (i < strlen(result)) { + if (result[i] == '\n') { + wprintw(windows[win_index]->win, "\n"); + win_print_time(windows[win_index], '-'); + } else { + waddch(windows[win_index]->win, result[i]); + } + + i++; + } + wprintw(windows[win_index]->win, "\n"); } }