Fix more of last commit
This commit is contained in:
parent
5c4c6bd806
commit
253e69413d
19
spmenu.c
19
spmenu.c
|
@ -470,19 +470,16 @@ void insert(const char *str, ssize_t n) {
|
||||||
int capsw = 0;
|
int capsw = 0;
|
||||||
|
|
||||||
// add width
|
// add width
|
||||||
if (!hidelarrow) larroww = pango_leftarrow ? TEXTWM(leftarrow) : TEXTW(leftarrow);
|
if (!hidelarrow) larroww = TEXTW(leftarrow);
|
||||||
if (!hiderarrow) rarroww = pango_rightarrow ? TEXTWM(rightarrow) : TEXTW(rightarrow);
|
if (!hiderarrow) rarroww = TEXTW(rightarrow);
|
||||||
if (!hidemode) modew = pango_mode ? TEXTWM(tx.modetext) : TEXTW(tx.modetext);
|
if (!hidemode) modew = MAX(MAX(TEXTW(normtext), TEXTW(instext)), TEXTW(regextext));
|
||||||
if (!hiderarrow) rarroww = pango_rightarrow ? TEXTWM(rightarrow) : TEXTW(rightarrow);
|
if (!hiderarrow) rarroww = TEXTW(rightarrow);
|
||||||
if (!hidematchcount) numberw = pango_numbers ? TEXTWM(tx.numbers) : TEXTW(tx.numbers);
|
if (!hidematchcount) numberw = TEXTW(tx.numbers);
|
||||||
if (!hidecaps) capsw = pango_caps ? TEXTWM(tx.capstext) : TEXTW(tx.capstext);
|
if (!hidecaps) capsw = MAX(TEXTW(capslockontext), TEXTW(capslockofftext));
|
||||||
|
|
||||||
if (!strcmp(tx.capstext, ""))
|
if (TEXTW(str) + TEXTW(tx.text) >= sp.inputw && selecteditem) {
|
||||||
capsw = 0;
|
|
||||||
|
|
||||||
if (n + TEXTW(tx.text) >= sp.inputw && selecteditem) {
|
|
||||||
return;
|
return;
|
||||||
} else if (n + TEXTW(tx.text) >= sp.mw - (sp.promptw + (!lines ? larroww : 0) + (!lines ? rarroww : 0) + modew + numberw + capsw + menumarginh)) {
|
} else if (TEXTW(str) + TEXTW(tx.text) >= sp.mw - (sp.promptw + (!lines ? larroww : 0) + (!lines ? rarroww : 0) + modew + numberw + capsw + menumarginh)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue