meta: replace bluelib with fx

This commit is contained in:
2026-03-16 14:07:33 +00:00
parent d2abb6faa3
commit e5546f97c2
105 changed files with 1668 additions and 1668 deletions

View File

@@ -113,7 +113,7 @@ void cursor_left(struct line_ed *ed)
{
if (ed->l_cursor_x != 0) {
//fputs("\010", stdout);
b_tty_move_cursor_x(ed->l_tty, B_TTY_POS_CURSOR, -1);
fx_tty_move_cursor_x(ed->l_tty, FX_TTY_POS_CURSOR, -1);
fflush(stdout);
ed->l_cursor_x--;
ed->l_buf_ptr--;
@@ -135,8 +135,8 @@ void cursor_left(struct line_ed *ed)
ed->l_cursor_x = len - 1;
//printf("\033[A\033[%dG", len + prompt_len);
b_tty_move_cursor_y(ed->l_tty, B_TTY_POS_CURSOR, -1);
b_tty_move_cursor_x(ed->l_tty, B_TTY_POS_START, (int)(len + prompt_len));
fx_tty_move_cursor_y(ed->l_tty, FX_TTY_POS_CURSOR, -1);
fx_tty_move_cursor_x(ed->l_tty, FX_TTY_POS_START, (int)(len + prompt_len));
fflush(stdout);
}
@@ -151,7 +151,7 @@ void cursor_right(struct line_ed *ed)
ed->l_cursor_x++;
ed->l_buf_ptr++;
//fputs("\033[C", stdout);
b_tty_move_cursor_x(ed->l_tty, B_TTY_POS_CURSOR, 1);
fx_tty_move_cursor_x(ed->l_tty, FX_TTY_POS_CURSOR, 1);
fflush(stdout);
return;
}
@@ -165,8 +165,8 @@ void cursor_right(struct line_ed *ed)
ed->l_buf_ptr++;
//printf("\033[B\033[G");
b_tty_move_cursor_y(ed->l_tty, B_TTY_POS_CURSOR, 1);
b_tty_move_cursor_x(ed->l_tty, B_TTY_POS_START, 0);
fx_tty_move_cursor_y(ed->l_tty, FX_TTY_POS_CURSOR, 1);
fx_tty_move_cursor_x(ed->l_tty, FX_TTY_POS_START, 0);
fflush(stdout);
}
@@ -178,13 +178,13 @@ void arrow_up(struct line_ed *ed)
if (ed->l_cursor_y > 0) {
//printf("\033[%uA", ed->l_cursor_y);
b_tty_move_cursor_y(ed->l_tty, B_TTY_POS_CURSOR, (long long)ed->l_cursor_y);
fx_tty_move_cursor_y(ed->l_tty, FX_TTY_POS_CURSOR, (long long)ed->l_cursor_y);
}
//printf("\033[%zuG\033[J", prompt_length(ed, PROMPT_MAIN) + 1);
b_tty_move_cursor_x(
ed->l_tty, B_TTY_POS_START, (long long)prompt_length(ed, PROMPT_MAIN));
b_tty_clear(ed->l_tty, B_TTY_CLEAR_SCREEN | B_TTY_CLEAR_FROM_CURSOR);
fx_tty_move_cursor_x(
ed->l_tty, FX_TTY_POS_START, (long long)prompt_length(ed, PROMPT_MAIN));
fx_tty_clear(ed->l_tty, FX_TTY_CLEAR_SCREEN | FX_TTY_CLEAR_FROM_CURSOR);
save_buf_to_history(ed);
ed->l_history_pos--;
@@ -196,18 +196,18 @@ void arrow_up(struct line_ed *ed)
void arrow_down(struct line_ed *ed)
{
if (ed->l_history_pos == b_array_size(ed->l_history) - 1) {
if (ed->l_history_pos == fx_array_size(ed->l_history) - 1) {
return;
}
if (ed->l_cursor_y > 0) {
//printf("\033[%uA", ed->l_cursor_y);
b_tty_move_cursor_y(ed->l_tty, B_TTY_POS_CURSOR, (int)ed->l_cursor_y);
fx_tty_move_cursor_y(ed->l_tty, FX_TTY_POS_CURSOR, (int)ed->l_cursor_y);
}
//printf("\033[%zuG\033[J", prompt_length(ed, PROMPT_MAIN) + 1);
b_tty_move_cursor_x(
ed->l_tty, B_TTY_POS_START, prompt_length(ed, PROMPT_MAIN) + 1);
fx_tty_move_cursor_x(
ed->l_tty, FX_TTY_POS_START, prompt_length(ed, PROMPT_MAIN) + 1);
save_buf_to_history(ed);
ed->l_history_pos++;