Commit Diff


commit - e0b650dde9b168f6ad7c514b910d82e1f3823e9d
commit + 9c2eaf349f94739d711574b409e7a16a5029c4f4
blob - cb7e417fbb6c1b4a20fd69bb5795d8aa5e587bec
blob + 496fa2a76631969be4f16551d4d26d12f362c19b
--- tog/tog.c
+++ tog/tog.c
@@ -182,7 +182,7 @@ draw_commit(struct got_commit_object *commit, struct g
 	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 g
 		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 g
 		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 g
 		waddch(tog_log_view.window, ' ');
 		col++;
 	}
-endline:
-	waddch(tog_log_view.window, '\n');
 done:
 	free(logmsg0);
 	free(wlogmsg);