CE edit save/restore terminal state
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m16s

This commit is contained in:
2026-03-07 01:58:47 +01:00
parent 75635bcc2e
commit eaec32975a
2 changed files with 6 additions and 3 deletions

View File

@@ -115,6 +115,8 @@ static size_t count_digits (size_t n) {
}
void edit_start (const char* file_path, const char* text) {
mprintf (ANSIQ_SCR_SAVE);
prepare_lines (text);
struct arena temp_arena;
memset (&temp_arena, 0, sizeof (temp_arena));
@@ -122,7 +124,7 @@ void edit_start (const char* file_path, const char* text) {
terminal_dimensions (&cols, &rows);
mprintf (ANSIQ_SCR_CLR_ALL ANSIQ_CUR_INVISIBLE);
mprintf (ANSIQ_CUR_INVISIBLE);
bool edit_run = true;
@@ -373,4 +375,5 @@ void edit_start (const char* file_path, const char* text) {
}
memset (&editor, 0, sizeof (editor));
mprintf (ANSIQ_SCR_RESTORE);
}

View File

@@ -10,8 +10,8 @@
#define ANSIQ_SCR_CLR2LEND ANSIQ_ESC"[0K" // Clear to end of line
#define ANSIQ_SCR_CLR2LBEG ANSIQ_ESC"[1K" // Clear to begining of line
#define ANSIQ_SCR_CLR_LINE ANSIQ_ESC"[2K" // Clear entire line
#define ANSIQ_SCR_RESTORE ANSIQ_ESC"[?47l"
#define ANSIQ_SCR_SAVE ANSIQ_ESC"[?47h"
#define ANSIQ_SCR_RESTORE ANSIQ_ESC"[?1049l"
#define ANSIQ_SCR_SAVE ANSIQ_ESC"[?1049h"
/* clang-format on */
#endif /* ANSIQ_SCREEN_H */