1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-29 19:56:07 -04:00

Include time in ddg search result output lines

This commit is contained in:
James Booth 2013-05-05 03:22:48 +01:00
parent 90ac69beb3
commit ae4c54bdcc

View File

@ -764,12 +764,25 @@ void
ui_duck_result(const char * const result) ui_duck_result(const char * const result)
{ {
int win_index = _find_prof_win_index("DuckDuckGo search"); int win_index = _find_prof_win_index("DuckDuckGo search");
if (win_index != NUM_WINS) { if (win_index != NUM_WINS) {
win_print_time(windows[win_index], '-'); win_print_time(windows[win_index], '-');
wattron(windows[win_index]->win, COLOUR_THEM); wattron(windows[win_index]->win, COLOUR_THEM);
wprintw(windows[win_index]->win, "Result : "); wprintw(windows[win_index]->win, "Result : ");
wattroff(windows[win_index]->win, COLOUR_THEM); 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"); wprintw(windows[win_index]->win, "\n");
} }
} }