diff options
Diffstat (limited to 'core/ninep/ctl.zig')
| -rw-r--r-- | core/ninep/ctl.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig index 2f008927..2b26c3e2 100644 --- a/core/ninep/ctl.zig +++ b/core/ninep/ctl.zig @@ -1281,7 +1281,8 @@ pub fn getFile(p: *Pardes, pane: *Pane, path: []const u8) GetError!void { f.disk_newer = null; f.disk_newer_warned = false; f.disk_gone = false; - if (fs.localPath(path) != null) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = true } }); + f.on_disk = fs.localPath(path) != null; + if (f.on_disk) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = true } }); } /// What Get and Edit's `e` fail with, as their callers say it (the 9P @@ -1312,6 +1313,7 @@ pub fn get(p: *Pardes, pane: *Pane) GetError!void { f.saved_len = f.content.len; f.disk_newer = null; f.disk_gone = false; + f.on_disk = fs.localPath(f.path) != null; if (discarded) { var rec: [32]u8 = undefined; pardes.ctlfs.events.notePath(p, "changed", std.fmt.bufPrint(&rec, "{d} reloaded", .{pane.serial}) catch unreachable); // a u32 fits 32 |
