use the full terminal width in tog log view
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/tog/tog.c b/tog/tog.c
index cb7e417..496fa2a 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -182,7 +182,7 @@ draw_commit(struct got_commit_object *commit, struct got_object_id *id)
int col, limit;
static const size_t id_display_cols = 8;
static const size_t author_display_cols = 16;
- const int avail = COLS - 1;
+ const int avail = COLS;
err = got_object_id_str(&id_str, id);
if (err)
@@ -196,12 +196,12 @@ draw_commit(struct got_commit_object *commit, struct got_object_id *id)
waddnstr(tog_log_view.window, id_str, limit);
}
col = limit + 1;
- while (col < avail && col < id_display_cols + 2) {
+ while (col <= avail && col < id_display_cols + 2) {
waddch(tog_log_view.window, ' ');
col++;
}
- if (col >= avail)
- goto endline;
+ if (col > avail)
+ goto done;
author0 = strdup(commit->author);
if (author0 == NULL) {
@@ -223,13 +223,13 @@ draw_commit(struct got_commit_object *commit, struct got_object_id *id)
goto done;
waddwstr(tog_log_view.window, wauthor);
col += author_width;
- while (col < avail && author_width < author_display_cols + 1) {
+ while (col <= avail && author_width < author_display_cols + 1) {
waddch(tog_log_view.window, ' ');
col++;
author_width++;
}
- if (col >= avail)
- goto endline;
+ if (col > avail)
+ goto done;
logmsg0 = strdup(commit->logmsg);
if (logmsg0 == NULL) {
@@ -252,8 +252,6 @@ draw_commit(struct got_commit_object *commit, struct got_object_id *id)
waddch(tog_log_view.window, ' ');
col++;
}
-endline:
- waddch(tog_log_view.window, '\n');
done:
free(logmsg0);
free(wlogmsg);