Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
version: [0.16.0]
version: [0.17.0]
runs-on: ${{matrix.os}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn build(b: *std.Build) void {

const run_cmd = b.addRunArtifact(tui);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| run_cmd.addArgs(args);
run_cmd.addPassthruArgs();

const run_step = b.step("run", "Run zf");
run_step.dependOn(&run_cmd.step);
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
.fingerprint = 0x30d847eef1728438,
.description = "a commandline fuzzy finder designed for filtering filepaths",
.version = "0.11.0",
.minimum_zig_version = "0.16.0",
.minimum_zig_version = "0.17.0",
.dependencies = .{
.vaxis = .{
.url = "git+https://github.com/rockorager/libvaxis.git#c1e1f23be38951c425cdf31af455ba23ef178940",
.hash = "vaxis-0.6.0-BWNV_MjFCQCs9UDHiRkrgw_ayeiPkzOe4xVbaAqXkUWW",
.url = "git+https://github.com/rockorager/libvaxis.git#6fd944a27fb3d6f596e981076381a3131f2448b4",
.hash = "vaxis-0.6.0-BWNV_MafDAAEzkVUvrW9NFUqnnMUoeHqrs2mecnD6D7w",
.lazy = true,
},
},
Expand Down
55 changes: 5 additions & 50 deletions src/tui/Previewer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -56,56 +56,11 @@ pub fn startThread(previewer: *Previewer, io: std.Io, loop: *vaxis.Loop(Event))
previewer.thread = try io.concurrent(threadLoop, .{ previewer, io, loop });
}

// TODO: can this be cleaned up?
const ThreadLoopError = error{
AccessDenied,
AntivirusInterference,
BadPathName,
Canceled,
ConcurrencyUnavailable,
ConnectionResetByPeer,
DeviceBusy,
FileBusy,
FileLocksUnsupported,
FileNotFound,
FileSystem,
FileTooBig,
InputOutput,
InvalidBatchScriptArg,
InvalidExe,
InvalidName,
InvalidProcessGroupId,
InvalidUserId,
InvalidWtf8,
IsDir,
LockViolation,
NameTooLong,
NetworkNotFound,
NoDevice,
NoSpaceLeft,
NotDir,
NotOpenForReading,
OperationUnsupported,
OutOfMemory,
PathAlreadyExists,
PermissionDenied,
PipeBusy,
ProcessAlreadyExec,
ProcessFdQuotaExceeded,
ReadOnlyFileSystem,
ResourceLimitReached,
SocketUnconnected,
StreamTooLong,
SymLinkLoop,
SystemFdQuotaExceeded,
SystemResources,
Timeout,
Unexpected,
UnrecognizedVolume,
WouldBlock,
};

fn threadLoop(previewer: *Previewer, io: std.Io, loop: *vaxis.Loop(Event)) ThreadLoopError!void {
// Vaxis does not return a bounded error set,
// so type reflection is required here.
const ThreadLoopError = @typeInfo(@typeInfo(@TypeOf(Previewer.threadLoop)).@"fn".return_type.?).error_union.error_set;

fn threadLoop(previewer: *Previewer, io: std.Io, loop: *vaxis.Loop(Event)) !void {
const allocator = previewer.arena.allocator();

while (true) {
Expand Down
Loading