diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kilo.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/kilo.c b/src/kilo.c index 5eef4aa..087adf6 100644 --- a/src/kilo.c +++ b/src/kilo.c @@ -1068,10 +1068,7 @@ static void editorGo(lua_State* L) { * is typing stuff on the terminal. */ static int Quit = 0; static int Back_to_big_picture = 0; -static void editorProcessKeypress(lua_State* L) { - int c = getch(); -//? mvprintw(LINES-3, 60, "key: %d\n", c); -//? getch(); +static void editorProcessKeypress2(int c) { switch(c) { case ENTER: { @@ -1092,16 +1089,6 @@ static void editorProcessKeypress(lua_State* L) { save_editor_state(E.rowoff, E.coloff, E.cy, E.cx); Quit = 1; break; - case CTRL_G: - /* Go to a different definition. */ - editorGo(L); - break; - case CTRL_B: - /* Go to big-picture view. */ - editorSaveToDisk(); - Quit = 1; - Back_to_big_picture = 1; - break; case CTRL_F: editorFind(); break; @@ -1173,6 +1160,26 @@ static void editorProcessKeypress(lua_State* L) { } } +static void editorProcessKeypress(lua_State* L) { + int c = getch(); +//? mvprintw(LINES-3, 60, "key: %d\n", c); +//? getch(); + switch(c) { + case CTRL_G: + /* Go to a different definition. */ + editorGo(L); + break; + case CTRL_B: + /* Go to big-picture view. */ + editorSaveToDisk(); + Quit = 1; + Back_to_big_picture = 1; + break; + default: + editorProcessKeypress2(c); + } +} + static void initEditor(void) { E.cx = 0; E.cy = 0; |