commit 084063cd60e09ca30740edba164d319222e9327c from: Stefan Sperling date: Thu Jul 12 13:45:59 2018 UTC tweak tog blame current line display and fix page-down scrolling commit - ab089a2a3acbaa8f750cfa1eea773efea685191c commit + 084063cd60e09ca30740edba164d319222e9327c blob - 1c84a1f621f5060040676c60f90137c47447cfd0 blob + 203a87b00c467b31c36e89501f7ddc6ad025ef2f --- tog/tog.c +++ tog/tog.c @@ -1124,8 +1124,8 @@ draw_blame(WINDOW *window, struct got_object_id *id, F if (width < COLS) waddch(window, '\n'); - if (asprintf(&line, "[%d-%d/%d] %s%s", - *first_displayed_line, *last_displayed_line, nlines, + if (asprintf(&line, "[%d/%d] %s%s", + *first_displayed_line - 1 + selected_line, nlines, path, blame_complete ? "" : " annotating...") == -1) { free(id_str); return got_error_from_errno(); @@ -1457,14 +1457,14 @@ show_blame_view(const char *path, struct got_object_id selected_line = 1; break; } - if (first_displayed_line > LINES - 1) - first_displayed_line -= (LINES - 1); + if (first_displayed_line > LINES - 2) + first_displayed_line -= (LINES - 2); else first_displayed_line = 1; break; case 'j': case KEY_DOWN: - if (selected_line < LINES - 1) + if (selected_line < LINES - 2) selected_line++; else if (last_displayed_line < nlines) first_displayed_line++; @@ -1492,15 +1492,15 @@ show_blame_view(const char *path, struct got_object_id case KEY_NPAGE: case ' ': if (last_displayed_line >= nlines && - selected_line < LINES - 1) { - selected_line = LINES - 1; + selected_line < LINES - 2) { + selected_line = LINES - 2; break; } - if (last_displayed_line + LINES - 1 <= nlines) - first_displayed_line += LINES - 1; + if (last_displayed_line + LINES - 2 <= nlines) + first_displayed_line += LINES - 2; else first_displayed_line = - nlines - (LINES - 2); + nlines - (LINES - 3); break; default: break;