--- lbbs/src/editor.c 2025/07/02 04:17:33 1.39 +++ lbbs/src/editor.c 2025/10/01 02:49:13 1.43 @@ -19,6 +19,7 @@ #include "editor.h" #include "io.h" #include "log.h" +#include "login.h" #include "memory_pool.h" #include "str_process.h" #include @@ -729,7 +730,9 @@ int editor_display(EDITOR_DATA *p_editor ch = igetch(100); // 0.1 second if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input { +#ifdef _DEBUG log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); +#endif str_len = 0; break; } @@ -741,6 +744,12 @@ int editor_display(EDITOR_DATA *p_editor { BBS_last_access_tm = time(NULL); + // Refresh current action while user input + if (user_online_update(NULL) < 0) + { + log_error("user_online_update(NULL) error\n"); + } + if (str_len == 0) // ch >= 32 && ch < 127 { input_str[0] = (char)ch; @@ -805,7 +814,7 @@ int editor_display(EDITOR_DATA *p_editor { col_pos = 1; } - if (ch != CR) + if (offset_out > 0) { col_pos += (str_len == 1 ? 1 : 2); } @@ -830,6 +839,12 @@ int editor_display(EDITOR_DATA *p_editor { BBS_last_access_tm = time(NULL); + // Refresh current action while user input + if (user_online_update(NULL) < 0) + { + log_error("user_online_update(NULL) error\n"); + } + if (ch == BACKSPACE) { if (line_current - output_current_row + row_pos <= 0 && col_pos <= 1) // Forbidden @@ -918,6 +933,7 @@ int editor_display(EDITOR_DATA *p_editor case KEY_TIMEOUT: goto cleanup; case Ctrl('W'): + case Ctrl('X'): loop = 0; break; case Ctrl('S'): // Start of line @@ -1119,6 +1135,12 @@ int editor_display(EDITOR_DATA *p_editor BBS_last_access_tm = time(NULL); + // Refresh current action while user input + if (user_online_update(NULL) < 0) + { + log_error("user_online_update(NULL) error\n"); + } + if (input_ok) { break;