mirror of
https://github.com/irssi/irssi.git
synced 2026-08-08 19:30:15 +02:00
Remove all debug code - nick column feature is complete
Removed: - All debug printtext() calls from formats.c and fe-expandos.c - debug_nick_column setting from fe-messages.c and config_dev - Debug includes and dependencies Reason: Debug was causing crashes due to timestamp formatting issues in different window contexts. Feature works correctly without debug. Final working state: - Nick alignment and truncation working properly - No crashes or segfaults - Clean production code without debug overhead Timestamp: 2025-01-25 02:36
This commit is contained in:
parent
5a8392f9d8
commit
507d9dd865
4 changed files with 6 additions and 38 deletions
|
|
@ -319,7 +319,6 @@ settings = {
|
|||
theme = "default.theme";
|
||||
nick_column_enabled = "yes";
|
||||
nick_column_width = "10";
|
||||
debug_nick_column = "yes";
|
||||
};
|
||||
"fe-text" = {
|
||||
lag_min_show = "1s";
|
||||
|
|
|
|||
|
|
@ -100,12 +100,7 @@ static char *expando_nickalign(SERVER_REC *server, void *item, int *free_ret)
|
|||
padding = width - total_chars;
|
||||
}
|
||||
|
||||
/* Debug output */
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG nickalign: nick='%s', mode='%s', width=%d, mode_chars=%d, nick_chars=%d, total_chars=%d, padding=%d",
|
||||
current_nick, mode, width, mode_chars, nick_chars, total_chars, padding);
|
||||
}
|
||||
|
||||
|
||||
*free_ret = TRUE;
|
||||
return g_strnfill(padding, ' ');
|
||||
|
|
@ -118,14 +113,7 @@ static char *expando_nicktrunc(SERVER_REC *server, void *item, int *free_ret)
|
|||
const char *mode;
|
||||
char *result;
|
||||
|
||||
/* Debug entry */
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG nicktrunc CALLED: enabled=%s, valid=%s, nick='%s'",
|
||||
settings_get_bool("nick_column_enabled") ? "yes" : "no",
|
||||
nick_context_valid ? "yes" : "no",
|
||||
current_nick ? current_nick : "NULL");
|
||||
}
|
||||
|
||||
|
||||
/* Gdy wyłączone - zwróć oryginalny nick */
|
||||
if (!settings_get_bool("nick_column_enabled")) {
|
||||
|
|
@ -151,29 +139,18 @@ static char *expando_nicktrunc(SERVER_REC *server, void *item, int *free_ret)
|
|||
/* Przytnij nick i dodaj >> */
|
||||
result = g_strdup_printf("%.*s>>", available_for_nick, current_nick);
|
||||
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG nicktrunc TRUNCATED: original='%s', truncated='%s', available_for_nick=%d",
|
||||
current_nick, result, available_for_nick);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Mode sam za długi */
|
||||
result = g_strdup(">>");
|
||||
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG nicktrunc MODE_TOO_LONG: result='%s'", result);
|
||||
}
|
||||
|
||||
}
|
||||
*free_ret = TRUE;
|
||||
return result;
|
||||
} else {
|
||||
/* Nick się zmieści - zwróć oryginalny */
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG nicktrunc NO_TRUNCATION: nick='%s', total_chars=%d <= width=%d",
|
||||
current_nick, total_chars, width);
|
||||
}
|
||||
|
||||
return current_nick;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -819,7 +819,6 @@ void fe_messages_init(void)
|
|||
/* Nick column feature settings */
|
||||
settings_add_bool("lookandfeel", "nick_column_enabled", FALSE);
|
||||
settings_add_int("lookandfeel", "nick_column_width", 12);
|
||||
settings_add_bool("lookandfeel", "debug_nick_column", FALSE);
|
||||
|
||||
signal_add_last("message public", (SIGNAL_FUNC) sig_message_public);
|
||||
signal_add_last("message private", (SIGNAL_FUNC) sig_message_private);
|
||||
|
|
|
|||
|
|
@ -922,14 +922,7 @@ char *format_get_text_theme_charargs(THEME_REC *theme, const char *module,
|
|||
text = modified_text;
|
||||
nick_formatting_depth--;
|
||||
|
||||
/* Debug output - send to current window, not status */
|
||||
if (settings_get_bool("debug_nick_column")) {
|
||||
WINDOW_REC *window = dest && dest->window ? dest->window : active_win;
|
||||
printtext_window(window, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG format_auto: formatnum=%d, original='%s'", formatnum, module_theme->expanded_formats[formatnum]);
|
||||
printtext_window(window, MSGLEVEL_CLIENTCRAP,
|
||||
"DEBUG format_auto: modified='%s'", text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
result = format_get_text_args(dest, text, args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue