From 68eb34051c9bc714a7367ecb860d5ddf78bd1982 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 12 Jan 2018 10:16:03 +0000 Subject: [PATCH] Improve logging for layout cells. --- usr.bin/tmux/layout.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/usr.bin/tmux/layout.c b/usr.bin/tmux/layout.c index 7f83af70ccc..c6240cbcb1e 100644 --- a/usr.bin/tmux/layout.c +++ b/usr.bin/tmux/layout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: layout.c,v 1.33 2017/11/15 19:59:27 nicm Exp $ */ +/* $OpenBSD: layout.c,v 1.34 2018/01/12 10:16:03 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -97,9 +97,24 @@ void layout_print_cell(struct layout_cell *lc, const char *hdr, u_int n) { struct layout_cell *lcchild; + const char *type; - log_debug("%s:%*s%p type %u [parent %p] wp=%p [%u,%u %ux%u]", hdr, n, - " ", lc, lc->type, lc->parent, lc->wp, lc->xoff, lc->yoff, lc->sx, + switch (lc->type) { + case LAYOUT_LEFTRIGHT: + type = "LEFTRIGHT"; + break; + case LAYOUT_TOPBOTTOM: + type = "TOPBOTTOM"; + break; + case LAYOUT_WINDOWPANE: + type = "WINDOWPANE"; + break; + default: + type = "UNKNOWN"; + break; + } + log_debug("%s:%*s%p type %s [parent %p] wp=%p [%u,%u %ux%u]", hdr, n, + " ", lc, type, lc->parent, lc->wp, lc->xoff, lc->yoff, lc->sx, lc->sy); switch (lc->type) { case LAYOUT_LEFTRIGHT: -- 2.20.1