Implement C-p and C-n for moving through history
@@ -196,12 +196,30 @@ int console_handle_event(Console *console,
history_prev(console->history);
return 0;
+ case SDLK_p:
+ if (event->key.keysym.mod & KMOD_CTRL) {
+ edit_field_replace(
+ console->edit_field, history_current(console->history));
+ history_prev(console->history);
+ return 0;
+ }
+ break;
+
case SDLK_DOWN:
edit_field_replace(
console->edit_field,
history_current(console->history));
history_next(console->history);
return 0;
+
+ case SDLK_n:
+ if (event->key.keysym.mod & KMOD_CTRL) {
+ edit_field_replace(
+ console->edit_field, history_current(console->history));
+ history_next(console->history);
+ return 0;
+ }
+ break;
}
} break;
}
