about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-14 00:07:28 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-14 00:07:28 -0800
commite451206e0677153c0d8474cb945ae6d6c20624ab (patch)
tree38f2909e183f4936a6483b929cd84d8cfd4b32fe
parentc5261224dfa8cdfd6f501f341affbc047465740e (diff)
downloadteliva-e451206e0677153c0d8474cb945ae6d6c20624ab.tar.gz
no, use Esc to cancel
It inserts an ugly pause for ghastly historical reasons having to do
with the origins of terminals. But hopefully this isn't a common case.
-rw-r--r--src/kilo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kilo.c b/src/kilo.c
index 25660d2..0cec5cb 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -780,15 +780,15 @@ static void editorFind() {
 
     while(1) {
         editorSetStatusMessage(
-            "Search: %s (Use ^g/Arrows/Enter)", query);
+            "Search: %s (Use Esc/Arrows/Enter)", query);
         editorRefreshScreen();
 
         int c = getch();
         if (c == KEY_BACKSPACE) {
             if (qlen != 0) query[--qlen] = '\0';
             last_match = -1;
-        } else if (c == CTRL_G || c == ENTER) {
-            if (c == CTRL_G) {
+        } else if (c == ESC || c == ENTER) {
+            if (c == ESC) {
                 E.cx = saved_cx; E.cy = saved_cy;
                 E.coloff = saved_coloff; E.rowoff = saved_rowoff;
             }
@@ -971,13 +971,13 @@ static void editorGo(lua_State* L) {
     qlen = strlen(query);
 
     while(1) {
-        editorSetStatusMessage("Jump to (^g to cancel): %s", query);
+        editorSetStatusMessage("Jump to (Esc to cancel): %s", query);
         editorRefreshScreen();
 
         int c = getch();
         if (c == KEY_BACKSPACE) {
             if (qlen != 0) query[--qlen] = '\0';
-        } else if (c == CTRL_G || c == ENTER) {
+        } else if (c == ESC || c == ENTER) {
             editorSetStatusMessage("");
             if (c == ENTER) {
               save_to_current_definition_and_editor_buffer(L, query);