Partially revert 44c7de3: fix items text width offset calculation 657122f7
Without this, we discard the item if it's longer than assigned width
instead of truncating it.
Quentin Rameau · 2016-07-25 11:33 1 file(s) · +2 −2
dmenu.c +2 −2
81 81
		n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">"));
82 82
	/* calculate which items will begin the next page and previous page */
83 83
	for (i = 0, next = curr; next; next = next->right)
84 -
		if ((i += (lines > 0) ? bh : TEXTW(next->text)) > n)
84 +
		if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n)
85 85
			break;
86 86
	for (i = 0, prev = curr; prev && prev->left; prev = prev->left)
87 -
		if ((i += (lines > 0) ? bh : TEXTW(prev->left->text)) > n)
87 +
		if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n)
88 88
			break;
89 89
}
90 90