summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 18:53:37 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitb8c5e8772e646fa21f6afdd2a875a1bd52848bd5 (patch)
tree70bca3d554501c49107b27396c7756e0e8ad62a3 /src/config.zig
parentc4ab29bce30f427decf3e199eebecfd415714a96 (diff)
downloadpardes-b8c5e8772e646fa21f6afdd2a875a1bd52848bd5.tar.gz
pardes-b8c5e8772e646fa21f6afdd2a875a1bd52848bd5.zip
A column can be empty, as acme's can; new panes go where acme's makenewwindow puts them
Newcol makes an empty column; closing a column's last pane leaves it empty with the keyboard on its tag; Delcol and Joincol alone take a column away; the session's last pane closing quits. The +New stand-in and replaceStillborn / stillborn_joiner are gone. Every new pane goes through exec.placeNew, which follows acme's makenewwindow (active column, empty column whole, blank space, halving the biggest) or, with Placement pardes, the old rules. ColumnTags is gone: column tags are always shown. A grip drag shows acme's box cursor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/config.zig b/src/config.zig
index 2eaaa505..48f49d50 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -73,11 +73,11 @@ pub const leader_path = paths: {
.Newcol = "cn",
.Delcol = "cd",
.Joincol = "cj",
+ .Placement = "cp",
.Debug = "td",
.Msg = null,
.Colors = "tc",
.FocusTint = null,
- .ColumnTags = null,
.SyntaxBold = null,
.Verbose = null,
.TreeContextTagStyle = null,
@@ -616,7 +616,6 @@ pub const Runtime = struct {
/// menu bar) turn it off and carry its commands there instead; the core
/// keeps the row as the acme tradition everywhere else.
workspace_tag: bool = true,
- column_tags: bool = true,
syntax_bold: bool = false,
/// A font's programming ligatures (`->`, `!=`) draw across their cells.
/// Only a shell that shapes text has the setting (`Capabilities.ligatures`).
@@ -664,8 +663,12 @@ pub const Runtime = struct {
/// never, while the window has the focus, or always (ghostty's
/// custom-shader-animation).
shader_animation: ShaderAnimation = .on,
+ /// Where a new pane goes (exec.placeNew): `acme`, acme's makenewwindow,
+ /// or `pardes`, the rules pardes had before it.
+ placement: Placement = .acme,
pub const ShaderAnimation = enum { off, on, always };
+ pub const Placement = enum { acme, pardes };
/// Each pass the bundled Crt or a Shadertoy file.
pub const Post = struct {
@@ -818,7 +821,7 @@ pub const Runtime = struct {
/// The message timings a setting word sets, each in milliseconds.
pub const MessageTime = enum { linger, fall, dissolve };
- pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, column_tags, syntax_bold, verbose, message_animation, ligatures };
+ pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, verbose, message_animation, ligatures };
/// The bundled post pass, a Shadertoy file in shaders/post/.
pub const Scene = enum { crt };
@@ -838,6 +841,7 @@ pub const Runtime = struct {
/// it of files.
shader,
shader_animation,
+ placement,
};
pub const Setting = struct {
@@ -861,7 +865,6 @@ pub const Runtime = struct {
.{ .word = "Tagbottom", .action = .{ .toggle = .tag_bottom } },
.{ .word = "Debug", .action = .{ .toggle = .debug } },
.{ .word = "FocusTint", .action = .{ .toggle = .focus_tint } },
- .{ .word = "ColumnTags", .action = .{ .toggle = .column_tags } },
.{ .word = "SyntaxBold", .action = .{ .toggle = .syntax_bold } },
.{ .word = "Verbose", .action = .{ .toggle = .verbose } },
.{ .word = "MessageAnimation", .action = .{ .toggle = .message_animation } },
@@ -890,6 +893,7 @@ pub const Runtime = struct {
.{ .word = "Crt", .action = .{ .scene = .crt }, .availability = .scene_shaders },
.{ .word = "Shader", .action = .shader, .availability = .scene_shaders },
.{ .word = "ShaderAnimation", .action = .shader_animation, .availability = .scene_shaders },
+ .{ .word = "Placement", .action = .placement },
};
pub fn find(name: []const u8) ?Setting {
@@ -1048,6 +1052,14 @@ pub const Runtime = struct {
const text = std.mem.trim(u8, argument orelse return false, " \t\r\n");
state.shader_animation = std.meta.stringToEnum(ShaderAnimation, text) orelse return false;
},
+ // Bare, it flips between the two, as a tag word should.
+ .placement => {
+ const text = std.mem.trim(u8, argument orelse "", " \t\r\n");
+ state.placement = if (text.len == 0)
+ (if (state.placement == .acme) .pardes else .acme)
+ else
+ std.meta.stringToEnum(Placement, text) orelse return false;
+ },
.theme, .font => return false,
}
return true;
@@ -1217,6 +1229,7 @@ pub const Runtime = struct {
try out.print("{s} {s}\n", .{ setting.word, @tagName(state.shader_animation) })
else
try out.print("{s} unsupported\n", .{setting.word}),
+ .placement => try out.print("{s} {s}\n", .{ setting.word, @tagName(state.placement) }),
};
if (context.startup_config_path) |path|
@@ -1468,6 +1481,7 @@ pub const Runtime = struct {
.dump_dir => "~/dumps",
.shader => "~/crt.glsl",
.shader_animation => "always",
+ .placement => "pardes",
else => null,
};
try std.testing.expect(apply(&state, setting, argument));
@@ -1483,7 +1497,6 @@ pub const Runtime = struct {
.tag_bottom => "Tagbottom on\n",
.debug => "Debug on\n",
.focus_tint => "FocusTint off\n",
- .column_tags => "ColumnTags off\n",
.syntax_bold => "SyntaxBold on\n",
.verbose => "Verbose off\n",
.message_animation => "MessageAnimation off\n",
@@ -1518,6 +1531,7 @@ pub const Runtime = struct {
},
.shader => "Shader ~/crt.glsl\n",
.shader_animation => "ShaderAnimation always\n",
+ .placement => "Placement pardes\n",
.theme, .font => unreachable,
};
try std.testing.expect(std.mem.indexOf(u8, report, expected) != null);