summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0007343)
raw | patch | inline | side by side (parent: 0007343)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 17 May 2010 03:31:34 +0000 (23:31 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 31 May 2010 12:30:12 +0000 (08:30 -0400) |
tig.c | patch | blob | history |
index f9d23ab53026e12236854ab0c168ebb783b6f91b..eaff28cdc04f98bdbffbd4f8e89b8da8e054feb0 100644 (file)
--- a/tig.c
+++ b/tig.c
enum keymap keymap; /* What keymap does this view have */
bool git_dir; /* Whether the view requires a git directory. */
- bool refresh; /* Whether the view supports refreshing. */
char ref[SIZEOF_REF]; /* Hovered commit reference */
char vid[SIZEOF_REF]; /* View ID. Set to id member when updating. */
static struct view_ops tree_ops;
static struct view_ops branch_ops;
-#define VIEW_STR(type, name, env, ref, ops, map, git, refresh) \
- { type, name, #env, ref, ops, map, git, refresh }
+#define VIEW_STR(type, name, env, ref, ops, map, git) \
+ { type, name, #env, ref, ops, map, git }
-#define VIEW_(id, name, ops, git, refresh, ref) \
- VIEW_STR(VIEW_##id, name, TIG_##id##_CMD, ref, ops, KEYMAP_##id, git, refresh)
+#define VIEW_(id, name, ops, git, ref) \
+ VIEW_STR(VIEW_##id, name, TIG_##id##_CMD, ref, ops, KEYMAP_##id, git)
static struct view views[] = {
- VIEW_(MAIN, "main", &main_ops, TRUE, TRUE, ref_head),
- VIEW_(DIFF, "diff", &diff_ops, TRUE, FALSE, ref_commit),
- VIEW_(LOG, "log", &log_ops, TRUE, TRUE, ref_head),
- VIEW_(TREE, "tree", &tree_ops, TRUE, FALSE, ref_commit),
- VIEW_(BLOB, "blob", &blob_ops, TRUE, FALSE, ref_blob),
- VIEW_(BLAME, "blame", &blame_ops, TRUE, FALSE, ref_commit),
- VIEW_(BRANCH, "branch", &branch_ops, TRUE, TRUE, ref_head),
- VIEW_(HELP, "help", &help_ops, FALSE, FALSE, ""),
- VIEW_(PAGER, "pager", &pager_ops, FALSE, FALSE, "stdin"),
- VIEW_(STATUS, "status", &status_ops, TRUE, TRUE, ""),
- VIEW_(STAGE, "stage", &stage_ops, TRUE, TRUE, ""),
+ VIEW_(MAIN, "main", &main_ops, TRUE, ref_head),
+ VIEW_(DIFF, "diff", &diff_ops, TRUE, ref_commit),
+ VIEW_(LOG, "log", &log_ops, TRUE, ref_head),
+ VIEW_(TREE, "tree", &tree_ops, TRUE, ref_commit),
+ VIEW_(BLOB, "blob", &blob_ops, TRUE, ref_blob),
+ VIEW_(BLAME, "blame", &blame_ops, TRUE, ref_commit),
+ VIEW_(BRANCH, "branch", &branch_ops, TRUE, ref_head),
+ VIEW_(HELP, "help", &help_ops, FALSE, ""),
+ VIEW_(PAGER, "pager", &pager_ops, FALSE, "stdin"),
+ VIEW_(STATUS, "status", &status_ops, TRUE, ""),
+ VIEW_(STAGE, "stage", &stage_ops, TRUE, ""),
};
#define VIEW(req) (&views[(req) - REQ_OFFSET - 1])
if (request > REQ_NONE) {
open_run_request(request);
- /* FIXME: When all views can refresh always do this. */
- if (view->refresh)
- request = REQ_REFRESH;
- else
- return TRUE;
+ view_request(view, REQ_REFRESH);
+ return TRUE;
}
request = view_request(view, request);