summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3af8774)
raw | patch | inline | side by side (parent: 3af8774)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 14 May 2006 07:23:44 +0000 (09:23 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Sun, 14 May 2006 07:23:44 +0000 (09:23 +0200) |
tig.c | patch | blob | history |
index d525251bf1215547d76f6c4ada0b39ccaf74b0c2..ae7dce9c41cfa40d0af450a6627b116f3736a304 100644 (file)
--- a/tig.c
+++ b/tig.c
size_t objsize; /* Size of objects in the line index */
struct view_ops {
+ /* What type of content being displayed. Used in the
+ * title bar. */
+ char *type;
/* Draw one line; @lineno must be < view->height. */
bool (*draw)(struct view *view, unsigned int lineno);
/* Read one line; updates view->line. */
wprintw(view->title, "[%s]", view->name);
if (view->lines) {
- char *type = view == VIEW(REQ_VIEW_MAIN) ? "commit" : "line";
-
wprintw(view->title, " - %s %d of %d (%d%%)",
- type,
+ view->ops->type,
view->lineno + 1,
view->lines,
(view->lineno + 1) * 100 / view->lines);
current_view = nviews;
/* Blur out the title of the previous view. */
update_view_title(prev);
- report("Switching to %s view", view->name);
+ report("");
return;
}
}
current_view = next_view;
/* Blur out the title of the previous view. */
update_view_title(view);
- report("Switching to %s view", display[current_view]->name);
+ report("");
break;
}
case REQ_TOGGLE_LINE_NUMBERS:
}
static struct view_ops pager_ops = {
+ "line",
pager_draw,
pager_read,
pager_enter,
}
static struct view_ops main_ops = {
+ "commit",
main_draw,
main_read,
main_enter,
struct ref *ref;
int namelen;
bool tag = FALSE;
+ bool tag_commit = FALSE;
if (!name)
continue;
if (name[namelen - 1] == '}') {
while (namelen > 0 && name[namelen] != '^')
namelen--;
+ if (namelen > 0)
+ tag_commit = TRUE;
}
name[namelen] = 0;
if (!strncmp(name, "refs/tags/", STRING_SIZE("refs/tags/"))) {
+ if (!tag_commit)
+ continue;
name += STRING_SIZE("refs/tags/");
tag = TRUE;