#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) {