diff --git a/ngp.c b/ngp.c index bb2b644..0615cbd 100644 --- a/ngp.c +++ b/ngp.c @@ -223,6 +223,10 @@ static void print_line(int *y, char *line) strncpy(cropped_line, line, crop); + /* first clear line */ + move(*y, 0); + clrtoeol(); + /* display line number */ pos = strtok_r(cropped_line, ":", &buf); attron(COLOR_PAIR(2)); @@ -265,6 +269,10 @@ static void print_file(int *y, char *line) char cropped_line[PATH_MAX] = ""; int crop = COLS; + /* first clear line */ + move(*y, 0); + clrtoeol(); + strncpy(cropped_line, line, crop); attron(COLOR_PAIR(5)); mvprintw(*y, 0, "%s", cropped_line,