summaryrefslogtreecommitdiff
path: root/core/ninep
diff options
context:
space:
mode:
Diffstat (limited to 'core/ninep')
-rw-r--r--core/ninep/ctl.zig4
-rw-r--r--core/ninep/events.zig2
-rw-r--r--core/ninep/pane.zig4
3 files changed, 7 insertions, 3 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
diff --git a/core/ninep/events.zig b/core/ninep/events.zig
index 6946401b..2d539cca 100644
--- a/core/ninep/events.zig
+++ b/core/ninep/events.zig
@@ -148,7 +148,7 @@ pub fn announce(p: *Pardes) void {
noteLog(p, .new, pane);
// A file, PDF or image opened (a look, a Restore, a boot): first in
// Recent.
- if (pardes.Pardes.recentPlace(pane)) |d| if (pardes.Pardes.recentKeeps(d.path)) p.recent.opened(p.recentGpa(), d.path);
+ if (pardes.Pardes.recentPlace(pane)) |d| if (pardes.Pardes.onDisk(pane)) p.recent.opened(p.recentGpa(), d.path);
}
}
diff --git a/core/ninep/pane.zig b/core/ninep/pane.zig
index e9e43095..b940bdd6 100644
--- a/core/ninep/pane.zig
+++ b/core/ninep/pane.zig
@@ -943,7 +943,9 @@ pub fn nameBuffer(p: *Pardes, id: usize, full: []const u8, preserve_tag: bool) !
look.invalidateLookHover(p, id);
p.emit(.{ .watch = .{ .pane = @intCast(id), .on = false } });
events.noteLog(p, .rename, pane);
- if (f.output == null and pardes.Pardes.recentKeeps(f.path)) p.recent.opened(p.recentGpa(), f.path);
+ // A name given: whether a file there is on disk is the disk's to say.
+ f.on_disk = f.output == null and pardes.Pardes.recentKeeps(f.path);
+ if (f.on_disk) p.recent.opened(p.recentGpa(), f.path);
}
/// Diagnostics go to the +Errors buffer of the pane's directory.