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
This commit is contained in:
kofany 2025-08-25 00:12:16 +02:00
commit cf9af2298e
2 changed files with 5 additions and 4 deletions

View file

@ -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";

View file

@ -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. */