// This software is highly Linux-specific, but I would be glad to get
// patches to make it work on other OS
// This software is highly Linux-specific, but I would be glad to get
// patches to make it work on other OS
void update_screen(int *current_line, int *temporary_line, int motion,
int nb_lines, char **lines,
void update_screen(int *current_line, int *temporary_line, int motion,
int nb_lines, char **lines,
// We fill the rest of the line with blanks if either we did
// not clear() or if this is the highlighted line
// We fill the rest of the line with blanks if either we did
// not clear() or if this is the highlighted line
- if(no_blink) { // Erase the rest of the window. That's slightly ugly.
- int k = 0;
- while(k < console_width) {
- buffer[k++] = ' ';
- }
- buffer[k++] = '\n';
- buffer[k++] = '\0';
- for(int l = nb_printed_lines; l < console_height; l++) {
- addnstr(buffer, console_width);
- }
- }
-
int main(int argc, char **argv) {
char buffer[buffer_size];
int main(int argc, char **argv) {
char buffer[buffer_size];
int color_fg_modeline, color_bg_modeline;
int color_fg_highlight, color_bg_highlight;
int color_fg_modeline, color_bg_modeline;
int color_fg_highlight, color_bg_highlight;
if(strcmp(argv[i], "-o") == 0) {
check_opt(argc, argv, i, 1, "<output filename>");
strncpy(output_filename, argv[i+1], buffer_size);
if(strcmp(argv[i], "-o") == 0) {
check_opt(argc, argv, i, 1, "<output filename>");
strncpy(output_filename, argv[i+1], buffer_size);
else if(strcmp(argv[i], "-l") == 0) {
check_opt(argc, argv, i, 1, "<maximum number of lines>");
nb_lines_max = atoi(argv[i+1]);
else if(strcmp(argv[i], "-l") == 0) {
check_opt(argc, argv, i, 1, "<maximum number of lines>");
nb_lines_max = atoi(argv[i+1]);
while(nb_lines < nb_lines_max && !file.eof()) {
file.getline(buffer, buffer_size);
if(strcmp(buffer, "") != 0) {
while(nb_lines < nb_lines_max && !file.eof()) {
file.getline(buffer, buffer_size);
if(strcmp(buffer, "") != 0) {
lines[nb_lines] = new char[strlen(s) + 1];
strcpy(lines[nb_lines], s);
nb_lines++;
lines[nb_lines] = new char[strlen(s) + 1];
strcpy(lines[nb_lines], s);
nb_lines++;
- update_screen(¤t_line, &temporary_line, 0, nb_lines, lines, patterns, no_blink);
+ update_screen(¤t_line, &temporary_line, 0, nb_lines, lines, patterns);
}
update_screen(¤t_line, &temporary_line, motion,
}
update_screen(¤t_line, &temporary_line, motion,
if(output_to_vt_buffer) {
if(temporary_line >= 0 && temporary_line < nb_lines) {
inject_into_tty_buffer(lines[temporary_line]);
if(output_to_vt_buffer) {
if(temporary_line >= 0 && temporary_line < nb_lines) {
inject_into_tty_buffer(lines[temporary_line]);