commit e0b650dde9b168f6ad7c514b910d82e1f3823e9d from: Stefan Sperling date: Sun May 20 18:22:49 2018 UTC fix drawing issue with overlong lines in tog diff commit - 963b370f7700cff85517f5c097cffb9a55553006 commit + e0b650dde9b168f6ad7c514b910d82e1f3823e9d blob - 1869ae4abd7d09e1fa6d34d1828179fe2f13366c blob + cb7e417fbb6c1b4a20fd69bb5795d8aa5e587bec --- tog/tog.c +++ tog/tog.c @@ -857,6 +857,7 @@ draw_diff(FILE *f, int *first_displayed_line, int *las char *line; size_t len; wchar_t *wline; + int width; rewind(f); werase(tog_diff_view.window); @@ -873,13 +874,14 @@ draw_diff(FILE *f, int *first_displayed_line, int *las continue; } - err = format_line(&wline, NULL, line, COLS); + err = format_line(&wline, &width, line, COLS); if (err) { free(line); return err; } waddwstr(tog_diff_view.window, wline); - waddch(tog_diff_view.window, '\n'); + if (width < COLS) + waddch(tog_diff_view.window, '\n'); if (++nprinted == 1) *first_displayed_line = nlines; free(line);