summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 22:27:38 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commitd4960472375ea68f709c56a677d8a37571419ff7 (patch)
tree8b5b2dde93eded887c7b1a17164137c3c09a4bb7 /src/pardes.zig
parentdfa5bd4d413504a6afff414962c4de70ab093af0 (diff)
downloadpardes-d4960472375ea68f709c56a677d8a37571419ff7.tar.gz
pardes-d4960472375ea68f709c56a677d8a37571419ff7.zip
Config opens the startup file, DumpConfig the settings report, and the workspace tag reads Dump Themes Config Debug Exit
Config (SPC f c) opens init, found as the settings report finds it (opts.startup_config_path: $XDG_CONFIG_HOME/pardes/init or ~/.config/pardes/init, and the macOS and Windows paths config.md gives). A pane that already holds it is gone to instead; a file on disk is looked at; with none, an empty pane is named for it, and Save makes its directory and any above it first (File.make_dirs, fs.makeDirs) before writing. Without a configuration directory it says so and opens nothing. The report Config used to open, the startup path and every live setting, is DumpConfig, in a +DumpConfig pane. No alias keeps the old meaning. The workspace tag's default words put Themes where NextColor was, NextColor staying a builtin, and Config beside it. A tag the user edited is kept as it was: a dump stores only an edited one (topbar_custom), and a restore puts back only that. theme.snap types NextColor onto the workspace tag to click it, and tagnav's walk back to Dump takes five long-word steps. The rest of the re-recorded goldens differ in the workspace words and their widths only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 18794975..e3db97d9 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -1329,7 +1329,7 @@ test "acme placement: New and 9P's new take the bottom half of the last pane" {
try std.testing.expect(p.rects[made].y > was.y + BOX_H);
}
-test "Placement pardes brings back the old rules, and says so in Config" {
+test "Placement pardes brings back the old rules, and says so in DumpConfig" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 40 });
defer p.deinit();
try std.testing.expect(p.executeBuiltinLine(p.active, "Placement pardes"));
@@ -3493,7 +3493,7 @@ test "s in a header selects in the header's own text" {
var ranges: [Text.max_selections]modal.Selection = undefined;
const text = try edit.flatSurface(p, &p.global_tag);
const got = p.global_tag.ranges(text, 0, &ranges);
- try std.testing.expectEqual(@as(usize, 3), got.n); // Newcol, Joincol, NextColor
+ try std.testing.expectEqual(@as(usize, 2), got.n); // Newcol, Joincol
try std.testing.expectEqual(@as(u16, 0), pane.body.nsel);
}
@@ -5261,7 +5261,7 @@ pub const Pardes = struct {
}
/// Resolve the request already handed to the GUI host. Requested and
- /// effective tuples deliberately remain separate so Config can show both.
+ /// effective tuples deliberately remain separate so DumpConfig can show both.
pub fn acknowledgeFont(
p: *Pardes,
effective_name: []const u8,
@@ -5596,6 +5596,8 @@ pub const Pardes = struct {
const was = f.saved_revision;
const failures = p.fs.failures;
f.saved_revision = f.revision;
+ if (f.make_dirs) if (filesystem.localPath(f.path)) |local|
+ filesystem.makeDirs(std.fs.path.dirname(local) orelse "/");
p.hostWriteFile(sf.pane, f.path, f.content);
const saved_pane = p.panes[sf.pane] orelse return;
if (saved_pane.serial != serial) return;
@@ -6721,7 +6723,7 @@ pub const Pardes = struct {
}
/// A native post pass proved unavailable: the chain is emptied, which
- /// Config then reports.
+ /// DumpConfig then reports.
pub fn disableSceneEffects(p: *Pardes) void {
p.settings.post.clear();
}