summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82e7800)
raw | patch | inline | side by side (parent: 82e7800)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 30 Apr 2006 21:37:55 +0000 (23:37 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Sun, 30 Apr 2006 21:37:55 +0000 (23:37 +0200) |
tig.c | patch | blob | history |
index de52602ec3d333b30ac212d3e5bd2f7211d7dff7..6d24716104fd988bc6b71bc32f1dfd687c1d8c02 100644 (file)
--- a/tig.c
+++ b/tig.c
LINE(DEFAULT, "", COLOR_DEFAULT, COLOR_DEFAULT, A_NORMAL),
LINE(CURSOR, "", COLOR_WHITE, COLOR_GREEN, A_BOLD),
LINE(STATUS, "", COLOR_GREEN, COLOR_DEFAULT, 0),
- LINE(TITLE, "", COLOR_YELLOW, COLOR_BLUE, A_BOLD),
+ LINE(TITLE, "", COLOR_WHITE, COLOR_BLUE, A_BOLD),
LINE(MAIN_DATE, "", COLOR_BLUE, COLOR_DEFAULT, 0),
LINE(MAIN_AUTHOR, "", COLOR_GREEN, COLOR_DEFAULT, 0),
LINE(MAIN_COMMIT, "", COLOR_DEFAULT, COLOR_DEFAULT, 0),
"git diff --find-copies-harder -B -C %s^ %s"
#define LOG_CMD \
- "git log --stat -n100 %s"
+ "git log --cc --stat -n100 %s"
#define MAIN_CMD \
"git log --stat --pretty=raw %s"
getmaxyx(view->win, view->height, view->width);
}
-/* FIXME: Fix percentage. */
-static void
-report_position(struct view *view, int all)
-{
- report(all ? "line %d of %d (%d%%)"
- : "line %d of %d",
- view->lineno + 1,
- view->lines,
- view->lines ? (view->lineno + 1) * 100 / view->lines : 0);
-}
-
static void
move_view(struct view *view, int lines)
redrawwin(view->win);
wrefresh(view->win);
-
- report_position(view, lines);
+ report("");
}
static void
redrawwin(view->win);
wrefresh(view->win);
-
- report_position(view, view->height);
+ report("");
}
goto end;
} else if (feof(view->pipe)) {
- report_position(view, 0);
+ report("loaded %d lines", view->lines);
goto end;
}
static void
report(const char *msg, ...)
{
+ struct view *view = display[current_view];
va_list args;
werase(title_win);
wmove(title_win, 0, 0);
- wprintw(title_win, "commit %s", commit_id);
+ if (view) {
+ wprintw(title_win, "[%s] ref: %s", view->name, commit_id);
+
+ if (view->lines) {
+ wprintw(title_win, " - line %d of %d (%d%%)",
+ view->lineno + 1,
+ view->lines,
+ view->lines ? (view->lineno + 1) * 100 / view->lines : 0);
+ }
+ } else {
+ wprintw(title_win, "commit %s", commit_id);
+ }
wrefresh(title_win);
va_start(args, msg);