Skip to content

Commit

Permalink
clear to end of line before starting to print line
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanklee committed Jul 7, 2014
1 parent a4f71db commit 39b72c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ngp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 39b72c5

Please sign in to comment.