summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6a2df0)
raw | patch | inline | side by side (parent: f6a2df0)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 15 Mar 2011 01:06:28 +0000 (21:06 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 16 Mar 2011 01:02:19 +0000 (21:02 -0400) |
tig.c | patch | blob | history |
index a4b27db47f2b7f52d7bab7d9a23f6e7f4db187c1..4a42cf7bbb7656d7c67b9bc57b366e58425156cf 100644 (file)
--- a/tig.c
+++ b/tig.c
bool (*grep)(struct view *view, struct line *line);
/* Select line */
void (*select)(struct view *view, struct line *line);
- /* Prepare view for loading */
- bool (*prepare)(struct view *view);
};
static struct view_ops blame_ops;
}
static bool
-view_open(struct view *view, enum open_flags flags)
+begin_update(struct view *view, const char *dir, enum open_flags flags)
{
bool reload = !!(flags & (OPEN_RELOAD | OPEN_REFRESH | OPEN_PREPARED));
bool refresh = flags & (OPEN_REFRESH | OPEN_PREPARED);
end_update(view, TRUE);
if (!refresh) {
- if (view->ops->prepare) {
- if (!view->ops->prepare(view))
- return FALSE;
- } else if (!prepare_io(view, NULL, view->ops->argv, TRUE)) {
+ if (!prepare_io(view, dir, view->ops->argv, TRUE))
return FALSE;
- }
/* Put the current ref_* value to the view title ref
* member. This is needed by the blob view. Most other
return TRUE;
}
+static bool
+view_open(struct view *view, enum open_flags flags)
+{
+ return begin_update(view, NULL, flags);
+}
+
static bool
update_view(struct view *view)
{
}
static bool
-tree_prepare(struct view *view)
+tree_open(struct view *view, enum open_flags flags)
{
if (view->lines == 0 && opt_prefix[0]) {
char *pos = opt_prefix;
opt_path[0] = 0;
}
- return prepare_io(view, opt_cdup, view->ops->argv, TRUE);
+ return begin_update(view, opt_cdup, flags);
}
static const char *tree_argv[SIZEOF_ARG] = {
static struct view_ops tree_ops = {
"file",
tree_argv,
- view_open,
+ tree_open,
tree_read,
tree_draw,
tree_request,
tree_grep,
tree_select,
- tree_prepare,
};
static bool