tangled
alpha
login
or
join now
brookjeynes.dev
/
jido
7
fork
atom
地圖 (Jido) is a lightweight Unix TUI file explorer designed for speed and simplicity.
7
fork
atom
overview
issues
pulls
pipelines
*:fmt
brookjeynes.dev
1 month ago
91f28563
8a32479f
+67
-48
15 changed files
expand all
collapse all
unified
split
build.zig.zon
src
app.zig
archive.zig
commands.zig
config.zig
directories.zig
drawer.zig
environment.zig
event_handlers.zig
file_logger.zig
image.zig
list.zig
main.zig
notification.zig
sort.zig
+1
-1
build.zig.zon
···
1
1
.{
2
2
.name = .jido,
3
3
.fingerprint = 0xee45eabe36cafb57,
4
4
-
.version = "1.3.0",
4
4
+
.version = "1.4.0",
5
5
.minimum_zig_version = "0.15.2",
6
6
7
7
.dependencies = .{
+14
-12
src/app.zig
···
1
1
const std = @import("std");
2
2
const builtin = @import("builtin");
3
3
-
const environment = @import("./environment.zig");
4
4
-
const Drawer = @import("./drawer.zig");
5
5
-
const Notification = @import("./notification.zig");
6
6
-
const config = &@import("./config.zig").config;
7
7
-
const List = @import("./list.zig").List;
8
8
-
const Directories = @import("./directories.zig");
9
9
-
const FileLogger = @import("./file_logger.zig");
10
10
-
const CircStack = @import("./circ_stack.zig").CircularStack;
11
11
-
const Image = @import("./image.zig");
12
12
-
const Archive = @import("./archive.zig");
13
13
-
const zuid = @import("zuid");
3
3
+
14
4
const vaxis = @import("vaxis");
15
5
const Key = vaxis.Key;
16
16
-
const EventHandlers = @import("./event_handlers.zig");
6
6
+
const zuid = @import("zuid");
7
7
+
8
8
+
const Archive = @import("./archive.zig");
9
9
+
const CircStack = @import("./circ_stack.zig").CircularStack;
17
10
const CommandHistory = @import("./commands.zig").CommandHistory;
11
11
+
const Directories = @import("./directories.zig");
12
12
+
const Drawer = @import("./drawer.zig");
13
13
+
const environment = @import("./environment.zig");
14
14
+
const EventHandlers = @import("./event_handlers.zig");
15
15
+
const FileLogger = @import("./file_logger.zig");
16
16
+
const Image = @import("./image.zig");
17
17
+
const List = @import("./list.zig").List;
18
18
+
const Notification = @import("./notification.zig");
18
19
20
20
+
const config = &@import("./config.zig").config;
19
21
const help_menu_items = [_][]const u8{
20
22
"Global:",
21
23
"<CTRL-c> :Exit.",
+2
-1
src/archive.zig
···
1
1
+
const ascii = @import("std").ascii;
1
2
const std = @import("std");
2
2
-
const ascii = @import("std").ascii;
3
3
+
3
4
const FileLogger = @import("./file_logger.zig");
4
5
5
6
const archive_buf_size = 8192;
+2
src/commands.zig
···
1
1
const std = @import("std");
2
2
+
2
3
const App = @import("app.zig");
3
4
const environment = @import("environment.zig");
5
5
+
4
6
const user_config = &@import("./config.zig").config;
5
7
6
8
pub const CommandHistory = struct {
+5
-3
src/config.zig
···
1
1
const std = @import("std");
2
2
const builtin = @import("builtin");
3
3
-
const environment = @import("./environment.zig");
3
3
+
4
4
const vaxis = @import("vaxis");
5
5
-
const FileLogger = @import("file_logger.zig");
6
6
-
const Notification = @import("./notification.zig");
5
5
+
7
6
const App = @import("./app.zig");
7
7
+
const environment = @import("./environment.zig");
8
8
+
const Notification = @import("./notification.zig");
9
9
+
const FileLogger = @import("file_logger.zig");
8
10
9
11
const CONFIG_NAME = "config.json";
10
12
const TRASH_DIR_NAME = "trash";
+8
-13
src/directories.zig
···
1
1
const std = @import("std");
2
2
+
3
3
+
const fuzzig = @import("fuzzig");
4
4
+
5
5
+
const CircStack = @import("./circ_stack.zig").CircularStack;
2
6
const List = @import("./list.zig").List;
3
3
-
const CircStack = @import("./circ_stack.zig").CircularStack;
7
7
+
8
8
+
const sort = &@import("./sort.zig");
4
9
const config = &@import("./config.zig").config;
5
5
-
const fuzzig = @import("fuzzig");
6
6
-
7
10
const history_len: usize = 100;
8
11
9
12
const Self = @This();
···
119
122
}
120
123
121
124
if (config.sort_dirs == true) {
122
122
-
std.mem.sort([]const u8, self.child_entries.all(), {}, sortChildEntry);
125
125
+
std.mem.sort([]const u8, self.child_entries.all(), {}, sort.string);
123
126
}
124
127
}
125
128
···
142
145
}
143
146
144
147
if (config.sort_dirs == true) {
145
145
-
std.mem.sort(std.fs.Dir.Entry, self.entries.all(), {}, sortEntry);
148
148
+
std.mem.sort(std.fs.Dir.Entry, self.entries.all(), {}, sort.sortDirectoryEntry);
146
149
}
147
147
-
}
148
148
-
149
149
-
fn sortEntry(_: void, lhs: std.fs.Dir.Entry, rhs: std.fs.Dir.Entry) bool {
150
150
-
return std.mem.lessThan(u8, lhs.name, rhs.name);
151
151
-
}
152
152
-
153
153
-
fn sortChildEntry(_: void, lhs: []const u8, rhs: []const u8) bool {
154
154
-
return std.mem.lessThan(u8, lhs, rhs);
155
150
}
156
151
157
152
pub fn clearEntries(self: *Self) void {
+10
-8
src/drawer.zig
···
1
1
const std = @import("std");
2
2
+
3
3
+
const vaxis = @import("vaxis");
4
4
+
const zeit = @import("zeit");
5
5
+
2
6
const App = @import("./app.zig");
3
3
-
const FileLogger = @import("./file_logger.zig");
4
4
-
const Notification = @import("./notification.zig");
7
7
+
const Archive = @import("./archive.zig");
5
8
const Directories = @import("./directories.zig");
6
6
-
const config = &@import("./config.zig").config;
7
7
-
const vaxis = @import("vaxis");
8
8
-
const sort = @import("./sort.zig");
9
9
+
const FileLogger = @import("./file_logger.zig");
9
10
const Git = @import("./git.zig");
11
11
+
const Image = @import("./image.zig");
10
12
const List = @import("./list.zig").List;
11
11
-
const zeit = @import("zeit");
12
12
-
const Image = @import("./image.zig");
13
13
-
const Archive = @import("./archive.zig");
13
13
+
const Notification = @import("./notification.zig");
14
14
+
const sort = @import("./sort.zig");
14
15
16
16
+
const config = &@import("./config.zig").config;
15
17
const Drawer = @This();
16
18
17
19
const top_div: u16 = 1;
+2
-1
src/environment.zig
···
1
1
const std = @import("std");
2
2
+
const builtin = @import("builtin");
3
3
+
2
4
const zuid = @import("zuid");
3
3
-
const builtin = @import("builtin");
4
5
5
6
pub fn getHomeDir() !?std.fs.Dir {
6
7
return try std.fs.openDirAbsolute(std.posix.getenv("HOME") orelse {
+6
-4
src/event_handlers.zig
···
1
1
const std = @import("std");
2
2
-
const App = @import("./app.zig");
3
3
-
const environment = @import("./environment.zig");
4
4
-
const zuid = @import("zuid");
2
2
+
5
3
const vaxis = @import("vaxis");
6
4
const Key = vaxis.Key;
7
7
-
const config = &@import("./config.zig").config;
5
5
+
const zuid = @import("zuid");
6
6
+
7
7
+
const App = @import("./app.zig");
8
8
const commands = @import("./commands.zig");
9
9
const Keybinds = @import("./config.zig").Keybinds;
10
10
+
const environment = @import("./environment.zig");
10
11
const events = @import("./events.zig");
11
12
13
13
+
const config = &@import("./config.zig").config;
12
14
pub fn handleGlobalEvent(
13
15
app: *App,
14
16
event: App.Event,
+2
src/file_logger.zig
···
1
1
const std = @import("std");
2
2
+
2
3
const environment = @import("environment.zig");
4
4
+
3
5
const config = &@import("./config.zig").config;
4
6
5
7
pub const LOG_PATH = "log.txt";
+2
src/image.zig
···
1
1
const std = @import("std");
2
2
+
2
3
const vaxis = @import("vaxis");
4
4
+
3
5
const App = @import("app.zig");
4
6
5
7
pub const Cache = struct {
+1
src/list.zig
···
1
1
const std = @import("std");
2
2
+
2
3
const vaxis = @import("vaxis");
3
4
4
5
pub fn List(comptime T: type) type {
+6
-4
src/main.zig
···
1
1
const std = @import("std");
2
2
const builtin = @import("builtin");
3
3
+
3
4
const options = @import("options");
4
4
-
const App = @import("app.zig");
5
5
-
const FileLogger = @import("file_logger.zig");
6
5
const vaxis = @import("vaxis");
7
7
-
const config = &@import("./config.zig").config;
6
6
+
pub const panic = vaxis.panic_handler;
7
7
+
8
8
const resolvePath = @import("./commands.zig").resolvePath;
9
9
+
const App = @import("app.zig");
10
10
+
const FileLogger = @import("file_logger.zig");
9
11
10
10
-
pub const panic = vaxis.panic_handler;
12
12
+
const config = &@import("./config.zig").config;
11
13
const help_menu =
12
14
\\Usage: jido
13
15
\\
+2
-1
src/notification.zig
···
1
1
const std = @import("std");
2
2
+
2
3
const vaxis = @import("vaxis");
4
4
+
3
5
const Event = @import("app.zig").Event;
4
4
-
5
6
const FileLogger = @import("file_logger.zig");
6
7
7
8
const Self = @This();
+4
src/sort.zig
···
3
3
pub fn string(_: void, lhs: []const u8, rhs: []const u8) bool {
4
4
return std.mem.lessThan(u8, lhs, rhs);
5
5
}
6
6
+
7
7
+
pub fn sortDirectoryEntry(_: void, lhs: std.fs.Dir.Entry, rhs: std.fs.Dir.Entry) bool {
8
8
+
return std.mem.lessThan(u8, lhs.name, rhs.name);
9
9
+
}