summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a006db6)
raw | patch | inline | side by side (parent: a006db6)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 22 May 2006 22:08:11 +0000 (00:08 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Mon, 22 May 2006 22:08:11 +0000 (00:08 +0200) |
tig.c | patch | blob | history |
index 4ab9434d7413f3c2c911cd19eda6ba2df38cc44f..6f716f50f98379053d2ffcd7c13d0f8478715ef3 100644 (file)
--- a/tig.c
+++ b/tig.c
#define foreach_view(view, i) \
for (i = 0; i < ARRAY_SIZE(display) && (view = display[i]); i++)
+#define displayed_views() (display[1] != NULL ? 2 : 1)
/**
* Current head and commit ID
bool split = !!(flags & OPEN_SPLIT);
bool reload = !!(flags & OPEN_RELOAD);
struct view *view = VIEW(request);
- int nviews = display[1] ? 2 : 1;
+ int nviews = displayed_views();
if (view == prev && nviews == 1 && !reload) {
report("Already in %s view", view->name);
case REQ_VIEW_NEXT:
{
- int nviews = display[1] ? 2 : 1;
+ int nviews = displayed_views();
int next_view = (current_view + 1) % nviews;
if (next_view == current_view) {