From 8c25fc4b0933e4f51fba4c97a12a4d3caef8dfe1 Mon Sep 17 00:00:00 2001 From: Juarez Rudsatz Date: Mon, 5 Feb 2024 15:59:15 -0300 Subject: [PATCH] column: add doc comment explaining ansi code detection --- text-utils/column.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/text-utils/column.c b/text-utils/column.c index 63c7def33..9d11fe7ac 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -113,6 +113,13 @@ typedef enum { ANSI_BSL = '\\' } ansi_esc_states; +/** + * Count how many characters are non-printable due to ANSI X3.41 escape codes. + * + * It detects and count only Fe Escape sequences. These sequences contains characters + * that normally are printable, but due to being part of a escape sequence are ignored + * when displayed in console terminals. + */ static inline size_t ansi_esc_width(ansi_esc_states *state, size_t *found, const wchar_t *str) { switch (*state) { -- 2.47.3