From 86b50b132978ecd3b17195ced3b2d351778487fb Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 20 Feb 2026 21:31:31 +0100 Subject: [PATCH 1/2] fix: re-arm fd_watcher in handle_read_ready --- src/file_watcher.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/file_watcher.zig b/src/file_watcher.zig index b258f29..0ef9e52 100644 --- a/src/file_watcher.zig +++ b/src/file_watcher.zig @@ -132,7 +132,10 @@ const INotifyBackend = struct { } } - fn handle_read_ready(self: *@This(), allocator: std.mem.Allocator, parent: tp.pid_ref) (std.posix.ReadError || error{ NoSpaceLeft, OutOfMemory, Exit })!void { + fn handle_read_ready(self: *@This(), allocator: std.mem.Allocator, parent: tp.pid_ref) (std.posix.ReadError || error{ ThespianFileDescriptorWaitReadFailed, NoSpaceLeft, OutOfMemory, Exit })!void { + // re-arm the file_discriptor + try self.fd_watcher.wait_read(); + const InotifyEvent = extern struct { wd: i32, mask: u32, From ea025be08b88658a9db85cda2840fb5d4530d4ad Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 20 Feb 2026 21:35:54 +0100 Subject: [PATCH 2/2] fix: renames of project files are deletes if the target already exists --- src/Project.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Project.zig b/src/Project.zig index 0869a69..2f3a517 100644 --- a/src/Project.zig +++ b/src/Project.zig @@ -808,6 +808,11 @@ pub fn file_modified(self: *Self, file_path: []const u8) void { } pub fn file_renamed(self: *Self, from_path: []const u8, to_path: []const u8) OutOfMemoryError!void { + for (self.files.items) |*file| { + if (!std.mem.eql(u8, file.path, to_path)) continue; + self.file_deleted(from_path); + return; + } for (self.files.items) |*file| { if (!std.mem.eql(u8, file.path, from_path)) continue; const new_path = try self.allocator.dupe(u8, to_path);