diff --git a/ce/edit.c b/ce/edit.c index 0041d7d..177029e 100644 --- a/ce/edit.c +++ b/ce/edit.c @@ -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); } diff --git a/libterminal/tscreen.h b/libterminal/tscreen.h index f2b5ce5..ce7790b 100644 --- a/libterminal/tscreen.h +++ b/libterminal/tscreen.h @@ -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 */