diff options
author | Quentin Rameau <quinq@fifth.space> | 2016-07-25 11:33:25 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-07-25 19:57:31 +0200 |
commit | 657122f7819fd74d66706ffb607deb44884401b7 (patch) | |
tree | ba95a01038cdf4ed7db37070c66c782800f4de30 /dmenu.c | |
parent | 3c91eed0fb74657c3fa25bc4fd65cd0aa88464c0 (diff) | |
download | dmenu-657122f7819fd74d66706ffb607deb44884401b7.tar.gz dmenu-657122f7819fd74d66706ffb607deb44884401b7.tar.bz2 dmenu-657122f7819fd74d66706ffb607deb44884401b7.zip |
Partially revert 44c7de3: fix items text width offset calculation
Without this, we discard the item if it's longer than assigned width
instead of truncating it.
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -81,10 +81,10 @@ calcoffsets(void) n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); /* calculate which items will begin the next page and previous page */ for (i = 0, next = curr; next; next = next->right) - if ((i += (lines > 0) ? bh : TEXTW(next->text)) > n) + if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n) break; for (i = 0, prev = curr; prev && prev->left; prev = prev->left) - if ((i += (lines > 0) ? bh : TEXTW(prev->left->text)) > n) + if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n) break; } |