diff options
| -rw-r--r-- | dmenu.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -81,10 +81,10 @@ calcoffsets(void) | |||
| 81 | n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); | 81 | n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); |
| 82 | /* calculate which items will begin the next page and previous page */ | 82 | /* calculate which items will begin the next page and previous page */ |
| 83 | for (i = 0, next = curr; next; next = next->right) | 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 | break; | 85 | break; |
| 86 | for (i = 0, prev = curr; prev && prev->left; prev = prev->left) | 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 | break; | 88 | break; |
| 89 | } | 89 | } |
| 90 | 90 | ||
