get rid of `Esc` hotkey

For a variety of historical reasons, terminals pause every time you
press `Esc`. Let's get rid of that lag.
This commit is contained in:
Kartik K. Agaram 2021-12-03 19:12:57 -08:00
parent fe5f542991
commit bbab1a7c10
3 changed files with 9 additions and 10 deletions

View File

@ -687,7 +687,7 @@ static void editorFindMenu(void) {
attrset(A_NORMAL);
extern int menu_column;
menu_column = 2;
draw_menu_item("Esc", "cancel");
draw_menu_item("^x", "cancel");
draw_menu_item("Enter", "submit");
draw_menu_item("^h", "back up cursor");
draw_menu_item("^u", "clear");
@ -713,7 +713,7 @@ static void editorGoMenu(void) {
attrset(A_NORMAL);
extern int menu_column;
menu_column = 2;
draw_menu_item("Esc", "cancel");
draw_menu_item("^x", "cancel");
draw_menu_item("Enter", "submit");
draw_menu_item("^h", "back up cursor");
draw_menu_item("^u", "clear");
@ -837,8 +837,8 @@ static void editorFind() {
if (c == KEY_BACKSPACE || c == DELETE || c == CTRL_H) {
if (qlen != 0) query[--qlen] = '\0';
last_match = -1;
} else if (c == ESC || c == ENTER) {
if (c == ESC) {
} else if (c == CTRL_X || c == ENTER) {
if (c == CTRL_X) {
E.cx = saved_cx; E.cy = saved_cy;
E.coloff = saved_coloff; E.rowoff = saved_rowoff;
}
@ -1039,7 +1039,7 @@ static void editorGo(lua_State* L) {
int c = getch();
if (c == KEY_BACKSPACE || c == DELETE || c == CTRL_H) {
if (qlen != 0) query[--qlen] = '\0';
} else if (c == ESC || c == ENTER) {
} else if (c == CTRL_X || c == ENTER) {
editorSetStatusMessage("");
if (c == ENTER) {
save_to_current_definition_and_editor_buffer(L, query);

View File

@ -442,7 +442,7 @@ static void recent_changes_menu (int cursor, int history_array_size) {
attrset(A_NORMAL);
extern int menu_column;
menu_column = 2;
draw_menu_item("Esc", "go back");
draw_menu_item("^x", "go back");
/* draw_menu_item("↓/space", "older"); */
attroff(A_REVERSE);
mvaddstr(LINES-1, menu_column, " ↓/space ");
@ -608,7 +608,7 @@ void recent_changes_view (lua_State *L) {
render_recent_changes(L, history_array, cursor, history_array_size);
int c = getch();
switch (c) {
case ESC:
case CTRL_X:
quit = 1;
break;
case KEY_DOWN:
@ -649,7 +649,7 @@ static void big_picture_menu (void) {
attrset(A_NORMAL);
extern int menu_column;
menu_column = 2;
draw_menu_item("Esc", "go back");
draw_menu_item("^x", "go back");
draw_menu_item("Enter", "submit");
draw_menu_item("^h", "back up cursor");
draw_menu_item("^u", "clear");
@ -816,7 +816,7 @@ restart:
int c = getch();
if (c == KEY_BACKSPACE || c == DELETE || c == CTRL_H) {
if (qlen != 0) query[--qlen] = '\0';
} else if (c == ESC) {
} else if (c == CTRL_X) {
return;
} else if (c == ENTER) {
save_to_current_definition_and_editor_buffer(L, query);

View File

@ -20,7 +20,6 @@ enum KEY_ACTION {
CTRL_S = 19,
CTRL_U = 21,
CTRL_X = 24,
ESC = 27,
CTRL_SLASH = 31,
DELETE = 127,
};