diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-13 23:59:05 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-13 23:59:05 -0800 |
commit | 8e9534ed4f186771d00e0955afaf93d3de057652 (patch) | |
tree | 15efd7fe8318ec893945bab9922e7dfa6fa91904 /src/kilo.c | |
parent | 711d764b376670e32e6099800a148e8327379c99 (diff) | |
download | teliva-8e9534ed4f186771d00e0955afaf93d3de057652.tar.gz |
editor: use ctrl-g to cancel dialogs
Diffstat (limited to 'src/kilo.c')
-rw-r--r-- | src/kilo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kilo.c b/src/kilo.c index 74f307d..e78e543 100644 --- a/src/kilo.c +++ b/src/kilo.c @@ -780,15 +780,15 @@ static void editorFind() { while(1) { editorSetStatusMessage( - "Search: %s (Use ^c/Arrows/Enter)", query); + "Search: %s (Use ^g/Arrows/Enter)", query); editorRefreshScreen(); int c = getch(); if (c == KEY_BACKSPACE) { if (qlen != 0) query[--qlen] = '\0'; last_match = -1; - } else if (c == CTRL_C || c == ENTER) { - if (c == ESC) { + } else if (c == CTRL_G || c == ENTER) { + if (c == CTRL_G) { E.cx = saved_cx; E.cy = saved_cy; E.coloff = saved_coloff; E.rowoff = saved_rowoff; } @@ -969,13 +969,13 @@ static void editorGo(lua_State* L) { qlen = strlen(query); while(1) { - editorSetStatusMessage("Jump to: %s", query); + editorSetStatusMessage("Jump to (^g to cancel): %s", query); editorRefreshScreen(); int c = getch(); if (c == KEY_BACKSPACE) { if (qlen != 0) query[--qlen] = '\0'; - } else if (c == CTRL_C || c == ENTER) { + } else if (c == CTRL_G || c == ENTER) { editorSetStatusMessage(""); if (c == ENTER) { save_to_current_definition_and_editor_buffer(L, query); |