summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig70
1 files changed, 1 insertions, 69 deletions
diff --git a/src/config.zig b/src/config.zig
index 647f3112..aea87230 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -171,19 +171,6 @@ pub const leader_path = paths: {
table.set(.ProgramEsc, null);
table.set(.Motion, null);
if (builtins.capabilities.lift) table.set(.GripWidth, null);
- if (builtins.capabilities.panel_transitions) {
- table.set(.PanelSlide, "as");
- table.set(.PanelZoom, "az");
- table.set(.PanelDissolve, "ad");
- table.set(.PanelAscii, "aa");
- table.set(.PanelVertical, "av");
- table.set(.PanelEdges, "ae");
- table.set(.PanelFall, "af");
- table.set(.PanelWave, "aw");
- table.set(.PanelCurtain, "ac");
- table.set(.PanelScramble, "ar");
- table.set(.PanelType, "at");
- }
if (builtins.TreeContext.enabled) table.set(.TreeContext, null);
table.set(.ThemeFile, null);
table.set(.DumpThemes, null);
@@ -776,7 +763,6 @@ pub const Runtime = struct {
tagline_percent: u8 = 100,
} = .{},
- panel_transition: animation.Transition = .off,
/// What a terminal's shell pages through (host_io.ChildEnv): `pardes`,
/// PAGER and GIT_PAGER set to `pardes -`, a +Pager pane, where the
/// user's environment set neither; `off`, the environment as it is.
@@ -871,7 +857,6 @@ pub const Runtime = struct {
pub const Capabilities = struct {
font_picker: bool,
- panel_transitions: bool,
tagline_font_size: bool,
window_opacity: bool = false,
window_blur: bool = false,
@@ -904,7 +889,6 @@ pub const Runtime = struct {
tab,
callstack_depth,
search_rows,
- transition: animation.Transition,
choice: Choice,
};
@@ -930,7 +914,6 @@ pub const Runtime = struct {
.font, .tagline_size => .font_picker,
.window_opacity => .window_opacity,
.window_blur => .window_blur,
- .transition => .panel_transitions,
.grip_width => .lift,
.toggle => |field| switch (field) {
.ligatures => .ligatures,
@@ -968,17 +951,6 @@ pub const Runtime = struct {
.{ .word = "TaglineSize", .action = .tagline_size, .doc = "Scale the tag font, a percentage." },
.{ .word = "WindowOpacity", .action = .window_opacity, .doc = "The window's opacity, a percentage." },
.{ .word = "WindowBlur", .action = .window_blur, .doc = "The blur behind a translucent window, a radius." },
- .{ .word = "PanelSlide", .action = .{ .transition = .slide }, .doc = "Panes slide in and out as they open and close, on or off." },
- .{ .word = "PanelZoom", .action = .{ .transition = .zoom }, .doc = "Panes zoom in and out as they open and close, on or off." },
- .{ .word = "PanelDissolve", .action = .{ .transition = .dissolve }, .doc = "Panes dissolve in and out as they open and close, on or off." },
- .{ .word = "PanelAscii", .action = .{ .transition = .ascii }, .doc = "Panes open and close through a scatter of ASCII, on or off." },
- .{ .word = "PanelVertical", .action = .{ .transition = .vertical }, .doc = "Panes open and close with a vertical wipe, on or off." },
- .{ .word = "PanelEdges", .action = .{ .transition = .edges }, .doc = "Panes open and close from their edges, on or off." },
- .{ .word = "PanelFall", .action = .{ .transition = .fall }, .doc = "Panes fall into place as they open, on or off." },
- .{ .word = "PanelWave", .action = .{ .transition = .wave }, .doc = "Panes open and close in a wave, on or off." },
- .{ .word = "PanelCurtain", .action = .{ .transition = .curtain }, .doc = "Panes open and close like a curtain, on or off." },
- .{ .word = "PanelScramble", .action = .{ .transition = .scramble }, .doc = "Panes open and close through scrambled text, on or off." },
- .{ .word = "PanelType", .action = .{ .transition = .typewriter }, .doc = "Panes type themselves in as they open, on or off." },
.{ .word = "Pager", .action = .{ .choice = .pager }, .doc = "What a terminal's commands page through: pardes, a +Pager pane (pardes -), or off, the environment's own; for terminals started after it." },
.{ .word = "PagerColor", .action = .{ .toggle = .pager_color }, .doc = "A +Pager keeps its program's colours, on or off; for the next text paged." },
.{ .word = "TermImages", .action = .{ .choice = .term_images }, .doc = "How a new terminal draws its program's kitty graphics: real, as pixels where it can, or petscii, as glyph art." },
@@ -1018,11 +990,6 @@ pub const Runtime = struct {
if (actionCount(.shell) != 1 or actionCount(.theme) != 1 or actionCount(.font) != 1 or
actionCount(.tagline_size) != 1 or actionCount(.window_opacity) != 1 or actionCount(.window_blur) != 1)
@compileError("Shell, Theme, Font, TaglineSize, WindowOpacity, and WindowBlur actions must each occur exactly once");
- for (std.enums.values(animation.Transition)) |effect| {
- const expected: comptime_int = @intFromBool(effect != .off);
- if (actionCount(.{ .transition = effect }) != expected)
- @compileError("non-off panel transition must occur exactly once: " ++ @tagName(effect));
- }
}
pub fn apply(state: *Runtime, setting: Setting, argument: ?[]const u8) bool {
@@ -1068,18 +1035,6 @@ pub const Runtime = struct {
inline else => |w| @field(state, "message_" ++ @tagName(w) ++ "_ms") = ms,
}
},
- // Panel effects are one choice, so `on` picks this one and `off`
- // turns it off only if it is the one on.
- .transition => |effect| {
- const want = switchedTo(argument) catch return false;
- if (want == null) {
- state.panel_transition = if (state.panel_transition == effect) .off else effect;
- } else if (want.?) {
- state.panel_transition = effect;
- } else if (state.panel_transition == effect) {
- state.panel_transition = .off;
- }
- },
// Bare, it steps to the next word, as a tag word should.
.choice => |which| switch (which) {
inline else => |field| {
@@ -1109,7 +1064,7 @@ pub const Runtime = struct {
}
};
return switch (action) {
- .toggle, .transition => "on, off",
+ .toggle => "on, off",
.choice => |which| switch (which) {
inline else => |field| comptime words.of(@FieldType(Runtime, @tagName(field))),
},
@@ -1244,8 +1199,6 @@ pub const Runtime = struct {
try out.writeByte('\n');
},
.tagline_size => try out.print("{s} {d}\n", .{ setting.word, state.font.tagline_percent }),
- // Each a switch of its own, the one in use on.
- .transition => |transition| try out.print("{s} {s}\n", .{ setting.word, onOff(state.panel_transition == transition) }),
.choice => |which| switch (which) {
inline else => |field| try out.print("{s} {s}\n", .{ setting.word, @tagName(@field(state, @tagName(field))) }),
},
@@ -1284,21 +1237,6 @@ pub const Runtime = struct {
try out.print("# Native images: {s}\n", .{onOff(context.native_images)});
}
- test "panel effects flip bare and are set by on and off" {
- var state: Runtime = .{};
- const slide = findAction(.{ .transition = .slide }).?;
- const zoom = findAction(.{ .transition = .zoom }).?;
- try std.testing.expect(apply(&state, slide, "on"));
- try std.testing.expectEqual(animation.Transition.slide, state.panel_transition);
- try std.testing.expect(apply(&state, zoom, "off"));
- try std.testing.expectEqual(animation.Transition.slide, state.panel_transition);
- try std.testing.expect(apply(&state, slide, "on"));
- try std.testing.expectEqual(animation.Transition.slide, state.panel_transition);
- try std.testing.expect(apply(&state, slide, null));
- try std.testing.expectEqual(animation.Transition.off, state.panel_transition);
- try std.testing.expect(!apply(&state, slide, "yes"));
- }
-
test "a toggle flips when bare and sets when told on or off" {
var state: Runtime = .{};
const verbose = find("Verbose").?;
@@ -1328,10 +1266,6 @@ pub const Runtime = struct {
try std.testing.expect(apply(&state, find("Shell").?, " fish\n"));
try std.testing.expectEqualStrings("fish", state.shell.requested.get());
try std.testing.expect(state.shell.pending);
- try std.testing.expect(apply(&state, find("PanelAscii").?, null));
- try std.testing.expectEqual(animation.Transition.ascii, state.panel_transition);
- try std.testing.expect(apply(&state, find("PanelAscii").?, null));
- try std.testing.expectEqual(animation.Transition.off, state.panel_transition);
}
test "tagline size validates before mutating live state" {
@@ -1432,7 +1366,6 @@ pub const Runtime = struct {
.native_images = true,
.capabilities = .{
.font_picker = true,
- .panel_transitions = true,
.tagline_font_size = true,
.window_opacity = true,
.window_blur = true,
@@ -1483,7 +1416,6 @@ pub const Runtime = struct {
defaults_context.native_images = false;
defaults_context.capabilities = .{
.font_picker = false,
- .panel_transitions = true,
.tagline_font_size = false,
};
defaults_context.state = &defaults;