feat: things
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
pub fn handle(action: Action, appState: *AppState) !void {
|
||||
pub fn handle(action: Action, appState: *AppState, arena: std.mem.Allocator) !void {
|
||||
switch (action) {
|
||||
.GoUp => {
|
||||
if (appState.currentTab.currentLocation) |currentLocation| {
|
||||
const parent = currentLocation.item.parent;
|
||||
if (parent) |p| {
|
||||
try appState.currentTab.setCurrentLocation(.{ .path = p.path.path });
|
||||
const path = try arena.dupe(u8, p.path.path);
|
||||
try appState.currentTab.setCurrentLocation(.{ .path = path });
|
||||
} else return error.NoParent;
|
||||
} else return error.NoCurrentLocation;
|
||||
},
|
||||
@@ -12,6 +13,7 @@ pub fn handle(action: Action, appState: *AppState) !void {
|
||||
}
|
||||
}
|
||||
|
||||
const std = @import("std");
|
||||
const Action = @import("action.zig").Action;
|
||||
const AppState = @import("../app_state.zig").AppState;
|
||||
const RootProvider = @import("../provider/root.zig").RootProvider;
|
||||
|
||||
Reference in New Issue
Block a user