fix:修正回车确认后残留提示的信息。

This commit is contained in:
taynpg 2025-01-21 13:11:37 +08:00
parent fcd61b381a
commit cca1e149cd

View File

@ -509,7 +509,7 @@ char* fc_readline()
SetConsoleCursorInfo(hConsole, &cursorInfo);
#endif
while (1) {
auto refresh_show = [&]() {
word.clear();
clear_line();
// Print current buffer
@ -533,6 +533,11 @@ char* fc_readline()
}
#endif
set_cursor_x(cur_pos + 1);
};
while (1) {
refresh_show();
need_predic = true;
// Read character from console
@ -555,6 +560,9 @@ char* fc_readline()
cursorInfo.bVisible = FALSE;
SetConsoleCursorInfo(hConsole, &cursorInfo);
#endif
// 这里还需要清除预测显示
str_predict.clear();
refresh_show();
append_his(main_buf);
return main_buf;
#if defined(OS_WINDOWS)