[hackers] [dmenu][PATCH] do not calculate inputw when using vertical mode

From: NRK <nrk_AT_disroot.org>
Date: Thu, 28 Apr 2022 05:14:33 +0600

inputw is never used for vertical mode, makes no sense to calculate it.
---
 dmenu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dmenu.c b/dmenu.c
index 839f6cc..6b02b2b 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -674,7 +674,7 @@ setup(void)
 		mw = wa.width;
 	}
 	promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
-	for (item = items; item && item->text; ++item) {
+	for (item = items; !lines && item && item->text; ++item) {
 		if ((tmp = textw_clamp(item->text, mw/3)) > inputw) {
 			if ((inputw = tmp) == mw/3)
 				break;
-- 
2.35.1
Received on Thu Apr 28 2022 - 01:14:33 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 28 2022 - 01:24:29 CEST