summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/format.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-02-26 21:53:42 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-02-26 21:53:42 +0000
commit2489407da540afa9a2bd6ac269c7c7f747a06937 (patch)
tree3e92961c42a2a0f0101a3fece1b4b5bf0f4eb049 /usr.bin/tmux/format.c
parent9d27aa2e2de16995db7363e5d339c415c264a596 (diff)
Check session, window, pane in the right order when working out format type.
Diffstat (limited to 'usr.bin/tmux/format.c')
-rw-r--r--usr.bin/tmux/format.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index a5b485335bf..5980c5d61d2 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.278 2021/02/26 07:53:26 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.279 2021/02/26 21:53:41 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -4696,12 +4696,12 @@ format_defaults(struct format_tree *ft, struct client *c, struct session *s,
if (c != NULL && s != NULL && c->session != s)
log_debug("%s: session does not match", __func__);
- if (s != NULL)
- ft->type = FORMAT_TYPE_SESSION;
+ if (wp != NULL)
+ ft->type = FORMAT_TYPE_PANE;
else if (wl != NULL)
ft->type = FORMAT_TYPE_WINDOW;
- else if (wp != NULL)
- ft->type = FORMAT_TYPE_PANE;
+ else if (s != NULL)
+ ft->type = FORMAT_TYPE_SESSION;
else
ft->type = FORMAT_TYPE_UNKNOWN;