shithub: orca

Download patch

ref: c2afc5c2c11aaae10c49dc57271d3e5f38900fcb
parent: 92256d59416074a298c6f1f5651b9ed526dd5f7a
author: cancel <cancel@cancel.fm>
date: Sat Jan 18 17:54:54 EST 2020

Cleanup

--- a/tui_main.c
+++ b/tui_main.c
@@ -3462,14 +3462,6 @@
     case CTRL_PLUS('o'):
       push_open_form(osoc(t.file_name));
       break;
-    case KEY_UP:
-    case CTRL_PLUS('k'):
-      ged_dir_input(&t.ged, Ged_dir_up, 1);
-      break;
-    case CTRL_PLUS('j'):
-    case KEY_DOWN:
-      ged_dir_input(&t.ged, Ged_dir_down, 1);
-      break;
     case 127: // backspace in terminal.app, apparently
     case KEY_BACKSPACE:
       if (t.ged.input_mode == Ged_input_mode_append) {
@@ -3480,14 +3472,6 @@
         ged_input_character(&t.ged, '.');
       }
       break;
-    case CTRL_PLUS('h'):
-    case KEY_LEFT:
-      ged_dir_input(&t.ged, Ged_dir_left, 1);
-      break;
-    case CTRL_PLUS('l'):
-    case KEY_RIGHT:
-      ged_dir_input(&t.ged, Ged_dir_right, 1);
-      break;
     case CTRL_PLUS('z'):
     case CTRL_PLUS('u'):
       ged_input_cmd(&t.ged, Ged_input_cmd_undo);
@@ -3609,6 +3593,28 @@
       ged_input_cmd(&t.ged, Ged_input_cmd_escape);
       break;
 
+    case 330: // delete?
+      ged_input_character(&t.ged, '.');
+      break;
+
+    // Cursor movement
+    case KEY_UP:
+    case CTRL_PLUS('k'):
+      ged_dir_input(&t.ged, Ged_dir_up, 1);
+      break;
+    case CTRL_PLUS('j'):
+    case KEY_DOWN:
+      ged_dir_input(&t.ged, Ged_dir_down, 1);
+      break;
+    case CTRL_PLUS('h'):
+    case KEY_LEFT:
+      ged_dir_input(&t.ged, Ged_dir_left, 1);
+      break;
+    case CTRL_PLUS('l'):
+    case KEY_RIGHT:
+      ged_dir_input(&t.ged, Ged_dir_right, 1);
+      break;
+
     // Selection size modification. These may not work in all terminals. (Only
     // tested in xterm so far.)
     case 337: // shift-up
@@ -3636,11 +3642,7 @@
       ged_modify_selection_size(&t.ged, 0, (int)t.ged.ruler_spacing_x);
       break;
 
-    case 330: // delete?
-      ged_input_character(&t.ged, '.');
-      break;
-
-    // Jump on control-arrow
+    // Move cursor further if control is held
     case 566: // control-up
       ged_dir_input(&t.ged, Ged_dir_up, (int)t.ged.ruler_spacing_y);
       break;