From cf9af2298eff880b950c92cdf5210997fbc7dc3f Mon Sep 17 00:00:00 2001 From: kofany Date: Mon, 25 Aug 2025 00:12:16 +0200 Subject: [PATCH] Fix nick character counting: Add missing underscore and pipe chars - Add missing '_' (underscore) and '|' (pipe) to count_nick_chars() - Now matches isnickchar definition from fe-messages.c - Fixes issue where nicks like 'big_Fat_boy' weren't truncated properly - Nick counting now includes: alphanumeric + `-_[]{}|\^ Test case: 'big_Fat_boy' (11 chars) should now be truncated to 'big_Fat_b>>' with width=10 Timestamp: 2025-01-25 00:08 --- config_dev | 2 +- src/fe-common/core/fe-expandos.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config_dev b/config_dev index 8e8acbf0..bff51fce 100644 --- a/config_dev +++ b/config_dev @@ -319,7 +319,7 @@ settings = { theme = "default.theme"; nick_column_enabled = "yes"; nick_column_width = "10"; - debug_nick_column = "yes"; + debug_nick_column = "no"; }; "fe-text" = { lag_min_show = "1s"; diff --git a/src/fe-common/core/fe-expandos.c b/src/fe-common/core/fe-expandos.c index b82bfc01..20054f04 100644 --- a/src/fe-common/core/fe-expandos.c +++ b/src/fe-common/core/fe-expandos.c @@ -58,9 +58,10 @@ static int count_nick_chars(const char *str) if (isalnum(*p)) { count++; } - /* Specjalne znaki nicka */ - else if (*p == '-' || *p == '[' || *p == ']' || *p == '\\' || - *p == '`' || *p == '^' || *p == '{' || *p == '}') { + /* Specjalne znaki nicka - zgodnie z isnickchar z fe-messages.c */ + else if (*p == '`' || *p == '-' || *p == '_' || + *p == '[' || *p == ']' || *p == '{' || *p == '}' || + *p == '|' || *p == '\\' || *p == '^') { count++; } /* Ignoruje kody kolorów %B %N %Y %n itp. */