summaryrefslogtreecommitdiff
path: root/src/file_watch.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_watch.zig')
-rw-r--r--src/file_watch.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file_watch.zig b/src/file_watch.zig
index b2908eb7..dfcce65f 100644
--- a/src/file_watch.zig
+++ b/src/file_watch.zig
@@ -382,6 +382,10 @@ fn watchPath(
}
const declared_path = path orelse return;
const watched_path = filesystem.localPath(declared_path) orelse return;
+ // The path may lie in a mount this editor serves, and marking it is a
+ // stat and a lookup out there: the turn goes out with them.
+ pardes.turn.yield();
+ defer pardes.turn.back();
const stat = std.Io.Dir.cwd().statFile(std.Io.Threaded.global_single_threaded.io(), watched_path, .{}) catch null;
const dir = if (stat != null and stat.?.kind == .directory) watched_path else std.fs.path.dirname(watched_path) orelse ".";
var dir_buf: [4096:0]u8 = undefined;
@@ -601,6 +605,8 @@ pub fn reloadTheme(
pub fn identify(io: std.Io, path: []const u8) !Identity {
const native = filesystem.localPath(path) orelse return error.NonLocalPath;
+ pardes.turn.yield();
+ defer pardes.turn.back();
const stat = try std.Io.Dir.cwd().statFile(io, native, .{});
if (stat.kind != .file) return error.NotFile;
return .{