feat: cleanup appstate, move sort to tab
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
pub fn handle_key(key: vaxis.Key, appState: *AppState, arena: std.mem.Allocator) !void {
|
||||
pub fn handle_key(key: vaxis.Key, appState: *AppState, arena: std.mem.Allocator) !ActionResult {
|
||||
if (key.matches(vaxis.Key.left, .{})) {
|
||||
try handle_action(Action.GoUp, appState, arena);
|
||||
return try handle_action(Action.GoUp, appState, arena);
|
||||
} else if (key.matches(vaxis.Key.up, .{})) {
|
||||
return try handle_action(Action.SelectPrevious, appState, arena);
|
||||
} else if (key.matches(vaxis.Key.down, .{})) {
|
||||
return try handle_action(Action.SelectNext, appState, arena);
|
||||
}
|
||||
|
||||
return ActionResult.None;
|
||||
}
|
||||
|
||||
const std = @import("std");
|
||||
const vaxis = @import("vaxis");
|
||||
const ActionResult = @import("../core/action/action.zig").ActionResult;
|
||||
const handle_action = @import("../core/action/action_handler.zig").handle;
|
||||
const Action = @import("../core/action/action.zig").Action;
|
||||
const AppState = @import("../core/app_state.zig").AppState;
|
||||
|
||||
Reference in New Issue
Block a user