summaryrefslogtreecommitdiff
path: root/src/Store.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Store.zig')
-rw-r--r--src/Store.zig12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/Store.zig b/src/Store.zig
index 02e5f83f..b1e8abd9 100644
--- a/src/Store.zig
+++ b/src/Store.zig
@@ -121,7 +121,6 @@ pub fn clone(s: *const Store, gpa: std.mem.Allocator) Store {
/// Recent read at start: the file, and the store it replaced.
pub fn load(s: *Store, p: *Pardes) void {
const path = s.path orelse return;
- if (comptime !pardes.hosted) return;
s.loaded = true;
s.refresh(p);
// ponytail: the store this file replaced (until 2026-11-05), a log
@@ -151,7 +150,6 @@ pub fn load(s: *Store, p: *Pardes) void {
/// the file, read. One stat when nothing changed.
pub fn refresh(s: *Store, p: *Pardes) void {
const path = s.path orelse return;
- if (comptime !pardes.hosted) return;
if (!s.loaded) return;
const io = ioOf();
const st = host(Dir.statFile, .{ cwd(), io, path, Dir.StatFileOptions{} }) catch return;
@@ -181,11 +179,11 @@ fn read(s: *Store, p: *Pardes, file: File) void {
/// end (`wait`: the lock is waited for there, never in a step).
pub fn flush(s: *Store, p: *Pardes, wait: bool) void {
if (!p.recent.dirty) return;
- if (s.path) |path| if (comptime pardes.hosted) {
+ if (s.path) |path| {
if (!s.loaded) return;
// Another session's lock: the next step tries again.
if (!s.write(p, path, wait)) return;
- };
+ }
// Written, or nowhere to write it (or the disk refused it: kept for
// no one, as before).
for (p.recent.entries.items) |*e| e.changed = false;
@@ -421,7 +419,6 @@ fn fileSize(path: []const u8) u64 {
}
test "store: two windows share Recent, each reading the other's writes on use; a busy lock delays, never loses" {
- if (comptime !pardes.hosted) return;
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
const path = try testPath(&tmp);
@@ -467,7 +464,6 @@ test "store: two windows share Recent, each reading the other's writes on use; a
}
test "store: Recent's file holds the newest 200, the newest first, and a window started on it reads them so" {
- if (comptime !pardes.hosted) return;
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
const path = try testPath(&tmp);
@@ -494,7 +490,6 @@ test "store: Recent's file holds the newest 200, the newest first, and a window
}
test "store: a foreign file never stops pardes: its lines that are Recent's are read, the next write mends it" {
- if (comptime !pardes.hosted) return;
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
const path = try testPath(&tmp);
@@ -512,7 +507,6 @@ test "store: a foreign file never stops pardes: its lines that are Recent's are
}
test "store: the store Recent's file replaced is read once, its newest records first, over the file's list" {
- if (comptime !pardes.hosted) return;
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
const path = try testPath(&tmp);
@@ -545,7 +539,6 @@ test "store: the store Recent's file replaced is read once, its newest records f
}
test "store: this session keeps its newest 64 closed panes" {
- if (comptime !pardes.hosted) return;
const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 48 });
defer p.deinit();
var serial: u32 = 0;
@@ -566,7 +559,6 @@ test "store: this session keeps its newest 64 closed panes" {
}
test "store: a closed pane comes back where it was, its rows from the pane that took them, nothing else moving; Panes lists it, marked" {
- if (comptime !pardes.hosted) return;
var tmp = testing.tmpDir(.{});
defer tmp.cleanup();
const path = try testPath(&tmp);