From 6d9c07af4db59e73d6f434f1ade4da919601f96c Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 4 Jun 2006 02:46:30 +0200 Subject: [PATCH] Make the view title show percentage shown like less The cursor position is already summoned up as "line x of X". --- tig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tig.c b/tig.c index 0f77167..1f36682 100644 --- a/tig.c +++ b/tig.c @@ -867,8 +867,9 @@ update_view_title(struct view *view) wprintw(view->title, "[%s]", view->name); if (view->lines || view->pipe) { + unsigned int view_lines = view->offset + view->height; unsigned int lines = view->lines - ? (view->lineno + 1) * 100 / view->lines + ? MIN(view_lines, view->lines) * 100 / view->lines : 0; wprintw(view->title, " - %s %d of %d (%d%%)", -- 2.30.2