summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aba2a4d)
raw | patch | inline | side by side (parent: aba2a4d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 15 Mar 2011 00:55:40 +0000 (20:55 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 16 Mar 2011 01:02:19 +0000 (21:02 -0400) |
tig.c | patch | blob | history |
index e7e34b1a3d3546f2e4b9f2192a2c65665467a766..a4b27db47f2b7f52d7bab7d9a23f6e7f4db187c1 100644 (file)
--- a/tig.c
+++ b/tig.c
}
static bool
-begin_update(struct view *view, bool refresh)
+view_open(struct view *view, enum open_flags flags)
{
+ bool reload = !!(flags & (OPEN_RELOAD | OPEN_REFRESH | OPEN_PREPARED));
+ bool refresh = flags & (OPEN_REFRESH | OPEN_PREPARED);
+
+ if (!reload && !strcmp(view->vid, view->id))
+ return TRUE;
+
if (view->pipe)
end_update(view, TRUE);
return;
}
restore_view_position(view);
-
- } else if ((reload || strcmp(view->vid, view->id)) &&
- !begin_update(view, flags & (OPEN_REFRESH | OPEN_PREPARED))) {
- report("Failed to load %s view", view->name);
- return;
}
if (split && prev->lineno - prev->offset >= prev->height) {
static struct view_ops pager_ops = {
"line",
NULL,
- NULL,
+ view_open,
pager_read,
pager_draw,
pager_request,
static struct view_ops log_ops = {
"line",
log_argv,
- NULL,
+ view_open,
pager_read,
pager_draw,
log_request,
static struct view_ops diff_ops = {
"line",
diff_argv,
- NULL,
+ view_open,
diff_read,
pager_draw,
pager_request,
static struct view_ops tree_ops = {
"file",
tree_argv,
- NULL,
+ view_open,
tree_read,
tree_draw,
tree_request,
static struct view_ops blob_ops = {
"line",
blob_argv,
- NULL,
+ view_open,
blob_read,
pager_draw,
blob_request,
static struct view_ops stage_ops = {
"line",
NULL,
- NULL,
+ view_open,
pager_read,
pager_draw,
stage_request,
static struct view_ops main_ops = {
"commit",
main_argv,
- NULL,
+ view_open,
main_read,
main_draw,
main_request,