Merge branch 'bakkeby:master' into master

This commit is contained in:
Minty Cube 2024-09-21 08:41:55 +00:00 committed by GitHub
commit b820f2c1fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -647,10 +647,18 @@ drawmenu(void)
} else if (matches) {
/* draw horizontal list */
x += inputw;
#if SYMBOLS_PATCH
w = TEXTW(symbol_1);
#else
w = TEXTW("<");
#endif // SYMBOLS_PATCH
if (curr->left) {
drw_setscheme(drw, scheme[SchemeNorm]);
#if SYMBOLS_PATCH
drw_text(drw, x, 0, w, bh, lrpad / 2, symbol_1, 0
#else
drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0
#endif // SYMBOLS_PATCH
#if PANGO_PATCH
, True
#endif // PANGO_PATCH

View File

@ -25,6 +25,7 @@ drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const cha
FcPattern *match;
XftResult result;
int charexists = 0;
int utf8err = 0;
int i, n;
if (!drw || (render && !drw->scheme) || !text || !drw->fonts || textlen <= 0
@ -56,14 +57,14 @@ drw_text_align(Drw *drw, int x, int y, unsigned int w, unsigned int h, const cha
while ((align == AlignL && i < textlen) || (align == AlignR && i > 0)) {
if (align == AlignL) {
utf8charlen = utf8decode(text + i, &utf8codepoint, MIN(textlen - i, UTF_SIZ));
utf8charlen = utf8decode(text + i, &utf8codepoint, &utf8err);
if (!utf8charlen) {
textlen = i;
break;
}
} else {
n = utf8nextchar(text, textlen, i, -1);
utf8charlen = utf8decode(text + n, &utf8codepoint, MIN(textlen - n, UTF_SIZ));
utf8charlen = utf8decode(text + n, &utf8codepoint, &utf8err);
if (!utf8charlen) {
textlen -= i;
text += i;