summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/Core.zig b/core/Core.zig
index 188df34c..b8ca9439 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -701,13 +701,21 @@ pub fn recentKeeps(path: []const u8) bool {
/// Recent keeps it.
pub fn noteClosed(p: *Pardes, pane: *const Pane) void {
const d = recentPlace(pane) orelse return;
- // The host asked first, always: what Recent holds is the
- // authority's, and a step that asked only when it did not know the
- // file would ask on one side and not the other.
- if (!recentKeeps(d.path) and p.recent.get(d.path) == null) return;
+ if (!onDisk(pane) and p.recent.get(d.path) == null) return;
p.recent.closed(p.recentGpa(), d.path, d.line, d.col, d.aline, d.acol);
}
+/// Whether a pane's file is one Recent keeps, as its open or last write
+/// learned it (File.State.on_disk; a kind's open read its file): never the
+/// disk, so a close or a pane installed asks nothing (a client's own Del or
+/// Zerox is instant). A file gone since that the watch has not said is
+/// noted all the same; Recent's reader skips it (Jump.jumpBy).
+pub fn onDisk(pane: *const Pane) bool {
+ if (pane.file) |f| return f.on_disk and !f.disk_gone;
+ if (pane.addon) |k| return filesystem.localPath(k.path) != null;
+ return false;
+}
+
pub const RecentPlace = struct { path: []const u8, line: u32, col: u32, aline: u32 = 0, acol: u32 = 0 };
/// Where a pane is, as Recent keeps it: a file's dot, a kind's pane's