diff --git a/ce/edit.c b/ce/edit.c index 875aac6..7f61f7d 100644 --- a/ce/edit.c +++ b/ce/edit.c @@ -86,7 +86,9 @@ void edit_start (const char* text) { mprintf (ANSIQ_SCR_SAVE ANSIQ_SCR_CLR_ALL ANSIQ_CUR_INVISIBLE); - for (;;) { + bool edit_run = true; + + while (edit_run) { update_horz_scroll (cols); update_vert_scroll (rows); @@ -201,6 +203,9 @@ void edit_start (const char* text) { case KB_END: editor.cursor.col = gapbuffer_length (&editor.current_line->gb); break; + case KB_CTRL ('Q'): + edit_run = false; + break; default: if (isprint (ch)) { gapbuffer_insert (&wrealloc, NULL, &editor.current_line->gb, ch); @@ -212,7 +217,7 @@ void edit_start (const char* text) { arena_reset (&temp_arena); } - mprintf (ANSIQ_CUR_VISIBLE ANSIQ_SCR_RESTORE); + mprintf (ANSIQ_SCR_CLR_ALL ANSIQ_CUR_VISIBLE ANSIQ_SCR_RESTORE); arena_destroy (&temp_arena);