From 7cbf358b5a89e84ed45dd26750ebb0875294df9f Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 26 Feb 2021 21:53:41 +0000 Subject: [PATCH] Check session, window, pane in the right order when working out format type. --- usr.bin/tmux/format.c | 10 +++++----- 1 file 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 @@ -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; -- 2.20.1