Fix a few things with the width

This commit is contained in:
Jacob 2023-07-29 00:19:31 +02:00
parent fa39098c2c
commit 2b1e5a1be1

View file

@ -383,12 +383,12 @@ void calcoffsets(void) {
if (lines > 0) { if (lines > 0) {
offset = lines * columns * sp.bh; offset = lines * columns * sp.bh;
sp.maxlen = sp.mw - (sp.promptw + modew + numberw + capsw + menumarginh);
} else { // no lines, therefore the size of items must be decreased to fit the menu elements } else { // no lines, therefore the size of items must be decreased to fit the menu elements
offset = sp.mw - (sp.promptw + sp.inputw + larroww + rarroww + modew + numberw + capsw + menumarginh); offset = sp.mw - (sp.promptw + sp.inputw + larroww + rarroww + modew + numberw + capsw + menumarginh);
sp.maxlen = selecteditem ? sp.inputw : sp.mw - (sp.promptw + modew + numberw + capsw + (selecteditem ? larroww : 0) + (selecteditem ? rarroww : 0));
} }
sp.maxlen = sp.mw - (sp.promptw + modew + numberw + capsw + menumarginh);
// calculate which items will begin the next page // calculate which items will begin the next page
for (i = 0, nextitem = currentitem; nextitem; nextitem = nextitem->right) { for (i = 0, nextitem = currentitem; nextitem; nextitem = nextitem->right) {
nextitem->nsgrtext = get_text_n_sgr(nextitem); nextitem->nsgrtext = get_text_n_sgr(nextitem);