- attron(COLOR_PAIR(1)); // Let's print something in red on black
- printw("%d/%d pattern: %s\n", nb_printed_lines, nb_lines - 2, regexp);
- attroff(COLOR_PAIR(1)); // Let's get back to default colors!
+ attron(COLOR_PAIR(1));
+ sprintf(buffer, "%d/%d pattern: %s", nb_printed_lines - 1, nb_lines, regexp);
+ for(int k = strlen(buffer); k < maxx - 1; k++) buffer[k] = ' ';
+ buffer[maxx-1] = '\0';
+ printw(buffer);
+ attroff(COLOR_PAIR(1));
+
+ refresh(); // After doing something on the display, we refresh it