From: nicm Date: Mon, 18 Oct 2021 09:48:35 +0000 (+0000) Subject: Fix menu width containing disabled items, from Alexis Hildebrandt in X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=31f1d14935f5b3f00b15ef1d6155c216eb781778;p=openbsd Fix menu width containing disabled items, from Alexis Hildebrandt in GitHub issue 2935. --- diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index 5eb90534d9e..345964ee592 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.38 2021/10/11 13:27:50 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.39 2021/10/18 09:48:35 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -100,6 +100,8 @@ menu_add_item(struct menu *menu, const struct menu_item *item, new_item->key = item->key; width = format_width(new_item->name); + if (*new_item->name == '-') + width--; if (width > menu->width) menu->width = width; }