We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d0258d0 + a81e42d commit 3def8aeCopy full SHA for 3def8ae
column.c
@@ -23,18 +23,7 @@ struct column_data {
23
/* return length of 's' in letters, ANSI escapes stripped */
24
static int item_length(const char *s)
25
{
26
- int len, i = 0;
27
- struct strbuf str = STRBUF_INIT;
28
-
29
- strbuf_addstr(&str, s);
30
- while ((s = strstr(str.buf + i, "\033[")) != NULL) {
31
- int len = strspn(s + 2, "0123456789;");
32
- i = s - str.buf;
33
- strbuf_remove(&str, i, len + 3); /* \033[<len><func char> */
34
- }
35
- len = utf8_strwidth(str.buf);
36
- strbuf_release(&str);
37
- return len;
+ return utf8_strnwidth(s, -1, 1);
38
}
39
40
/*
0 commit comments