shithub: orca

Download patch

ref: cd0d783af02ac8d9f769f8941812a276e83f23e4
parent: f865f1a64f13e4ef0edd5aa2b0f6d5621b22ba84
author: cancel <cancel@cancel.fm>
date: Sun Dec 2 11:19:38 EST 2018

Change quit combination to ctrl+q/d/g

--- a/tui_main.c
+++ b/tui_main.c
@@ -7,6 +7,8 @@
 #include <locale.h>
 #include <ncurses.h>
 
+#define AND_CTRL(c) ((c)&037)
+
 static void usage() {
   // clang-format off
   fprintf(stderr,
@@ -249,7 +251,7 @@
   intrflush(stdscr, FALSE);
   // Receive keyboard input immediately, and receive shift, control, etc. as
   // separate events, instead of combined with individual characters.
-  raw();
+  // raw();
   // Don't echo keyboard input
   noecho();
   // Also receive arrow keys, etc.
@@ -307,7 +309,9 @@
     }
 
     switch (key) {
-    case 'q':
+    case AND_CTRL('q'):
+    case AND_CTRL('d'):
+    case AND_CTRL('g'):
       goto quit;
     case ' ':
       orca_run(field.buffer, markmap_r.buffer, field.height, field.width,