Skip to content

Commit 39b72c5

Browse files
author
Jonathan Klee (jklee)
committed
clear to end of line before starting to print line
1 parent a4f71db commit 39b72c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ngp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ static void print_line(int *y, char *line)
223223

224224
strncpy(cropped_line, line, crop);
225225

226+
/* first clear line */
227+
move(*y, 0);
228+
clrtoeol();
229+
226230
/* display line number */
227231
pos = strtok_r(cropped_line, ":", &buf);
228232
attron(COLOR_PAIR(2));
@@ -265,6 +269,10 @@ static void print_file(int *y, char *line)
265269
char cropped_line[PATH_MAX] = "";
266270
int crop = COLS;
267271

272+
/* first clear line */
273+
move(*y, 0);
274+
clrtoeol();
275+
268276
strncpy(cropped_line, line, crop);
269277
attron(COLOR_PAIR(5));
270278
mvprintw(*y, 0, "%s", cropped_line,

0 commit comments

Comments
 (0)