eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit f9b7e32c2d6d3b6f13f73e2e127b11686daa7546
parent 0c8f06441e69bdb1cbe58becf53f03d4d9a8dfd6
Author: James Prestwood <prestwoj@gmail.com>
Date:   Fri,  7 Oct 2022 12:59:37 -0700

client: better support utf-8 for table rows

The utf-8 bytes were being counted as normal ascii so the
width maximum was not being increased to include
non-printable bytes like it is for color escape sequences.
This lead to the row not printing enough characters which
effected the text further down the line.

Fix this by increasing 'max' when non-codepoint utf-8
characters are found.

Diffstat:
Mclient/display.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/display.c b/client/display.c @@ -410,7 +410,9 @@ static char* next_line(char *s, unsigned int *max, char **color_out) /* color escape won't count for column width */ *max += color_end(s + i); last_color = i; - } + /* Add width for non-codepoint UTF-8 bytes */ + } else if (((uint8_t)s[i] >> 6) == 2) + *max += 1; } /* Reached the end of the string within the column bounds */