diff options
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/src/config.zig b/src/config.zig index dbe4e9b7..9a7e6848 100644 --- a/src/config.zig +++ b/src/config.zig @@ -158,10 +158,7 @@ pub const leader_path = paths: { table.set(.Font, null); table.set(.TaglineSize, null); } - table.set(.MessageAnimation, null); table.set(.MessageLinger, null); - table.set(.MessageFall, null); - table.set(.MessageDissolve, null); table.set(.DumpDir, null); if (builtins.capabilities.window_opacity) table.set(.WindowOpacity, null); if (builtins.capabilities.window_blur) table.set(.WindowBlur, null); @@ -365,8 +362,7 @@ pub const wheel_cols: i32 = 4; pub const look_preview_delay_frames: u16 = 2; -/// The longest any message timing (MessageLinger, MessageFall, -/// MessageDissolve) may be set to, in milliseconds. +/// The longest MessageLinger may be set to, in milliseconds. pub const message_ms_max: u16 = 60_000; // Tag fonts keep body-cell geometry; valid sizes are 1...100 percent. @@ -725,8 +721,6 @@ pub const Runtime = struct { /// Builtins announce themselves on the message row. verbose: bool = true, - /// A message falls into its row and dissolves out of it. - message_animation: bool = true, /// The cursor blinks, a pixel shell's (docs/render-pipeline.md §5.4): /// solid while typing and for half a second after, eased at each edge, /// solid again after ten idle seconds. @@ -739,12 +733,6 @@ pub const Runtime = struct { program_esc: bool = false, /// How long a message stays after the key or click that dismisses it. message_linger_ms: u16 = 800, - /// How long its fall into the row takes, easing out (§8.1: arriving, - /// 150 to 220 ms). - message_fall_ms: u16 = 180, - /// How long its dissolve takes, easing in: leaving is quicker than - /// arriving (§8.1: 100 to 160 ms). - message_dissolve_ms: u16 = 150, /// Where Dump writes and a relative Restore looks; empty is the default /// ($XDG_DATA_HOME/pardes, else ~/.local/share/pardes). dump_dir: Text(limits.host_path_cap) = .{}, @@ -879,10 +867,7 @@ pub const Runtime = struct { pub const Capability = std.meta.FieldEnum(Capabilities); - /// 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, syntax_bold, pager_color, verbose, message_animation, ligatures, cursor_blink, jump_trail, program_esc }; + pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, pager_color, verbose, ligatures, cursor_blink, jump_trail, program_esc }; pub const Action = union(enum) { toggle: Toggle, @@ -892,7 +877,7 @@ pub const Runtime = struct { tagline_size, window_opacity, window_blur, - message_ms: MessageTime, + message_linger, dump_dir, /// A motion flavour. motion, @@ -948,7 +933,6 @@ pub const Runtime = struct { .{ .word = "FocusTint", .action = .{ .toggle = .focus_tint }, .doc = "The focused pane's and column's tags are tinted, on or off." }, .{ .word = "SyntaxBold", .action = .{ .toggle = .syntax_bold }, .doc = "Keywords and the like are drawn bold, on or off." }, .{ .word = "Verbose", .action = .{ .toggle = .verbose }, .doc = "A builtin says its own name on the message row as it runs, on or off." }, - .{ .word = "MessageAnimation", .action = .{ .toggle = .message_animation }, .doc = "A message falls into its row and dissolves out of it, on or off." }, .{ .word = "Ligatures", .action = .{ .toggle = .ligatures }, .doc = "A font's programming ligatures draw across their cells, on or off." }, .{ .word = "CursorBlink", .action = .{ .toggle = .cursor_blink }, .doc = "The cursor blinks, solid while typing, on or off." }, .{ .word = "JumpTrail", .action = .{ .toggle = .jump_trail }, .doc = "A jump of the cursor leaves a short trail that fades, on or off." }, @@ -957,9 +941,7 @@ pub const Runtime = struct { .{ .word = "GripWidth", .action = .grip_width, .doc = "The grip and scrollbar width, as a percent of the theme's rail." }, .{ .word = "InactiveDim", .action = .inactive_dim, .doc = "Fade the unfocused panes' text by a percentage, 0 through 100, 0 off." }, .{ .word = "Pet", .action = .{ .choice = .pet }, .doc = "The window's companion in the workspace tag's blank space: off, cat or frog." }, - .{ .word = "MessageLinger", .action = .{ .message_ms = .linger }, .doc = "How long, in milliseconds, a message stays after what dismisses it." }, - .{ .word = "MessageFall", .action = .{ .message_ms = .fall }, .doc = "How long, in milliseconds, a message takes to fall into its row." }, - .{ .word = "MessageDissolve", .action = .{ .message_ms = .dissolve }, .doc = "How long, in milliseconds, a message takes to dissolve." }, + .{ .word = "MessageLinger", .action = .message_linger, .doc = "How long, in milliseconds, a message stays after what dismisses it." }, .{ .word = "DumpDir", .action = .dump_dir, .doc = "The directory Dump writes to and a relative Restore reads from; bare, the default." }, .{ .word = "Theme", .action = .theme, .doc = "Switch to the named theme." }, .{ .word = "Shell", .action = .shell, .doc = "The shell new terminals run; bare, $SHELL if it is executable, else /bin/sh." }, @@ -1045,12 +1027,7 @@ pub const Runtime = struct { } if (!state.dump_dir.set(text)) return false; }, - .message_ms => |which| { - const ms = number(u16, argument, " \t\r\n", 0, message_ms_max) orelse return false; - switch (which) { - inline else => |w| @field(state, "message_" ++ @tagName(w) ++ "_ms") = ms, - } - }, + .message_linger => state.message_linger_ms = number(u16, argument, " \t\r\n", 0, message_ms_max) orelse return false, // Bare, it steps to the next word, as a tag word should. .choice => |which| switch (which) { inline else => |field| { @@ -1100,7 +1077,7 @@ pub const Runtime = struct { .callstack_depth => "1-64 (levels)", .search_rows => "1-100 (rows)", .tagline_size => std.fmt.comptimePrint("{d}-{d} (a percentage)", .{ tagline_percent_min, tagline_percent_max }), - .message_ms => std.fmt.comptimePrint("0-{d} (milliseconds)", .{message_ms_max}), + .message_linger => std.fmt.comptimePrint("0-{d} (milliseconds)", .{message_ms_max}), .shell => "a path of at most 255 bytes; bare, $SHELL, else /bin/sh", .dump_dir => std.fmt.comptimePrint("an absolute or ~ path of at most {d} bytes, to a directory that may be written; bare, the default", .{limits.host_path_cap}), .font => "a name or path, :8 to :72 after it (Mono:14)", @@ -1193,9 +1170,7 @@ pub const Runtime = struct { const dir = if (state.dump_dir.len > 0) state.dump_dir.get() else context.default_dump_dir; if (dir.len > 0) try out.print("{s} {s}\n", .{ setting.word, dir }) else try out.print("# {s} (none)\n", .{setting.word}); }, - .message_ms => |which| try out.print("{s} {d}\n", .{ setting.word, switch (which) { - inline else => |w| @field(state, "message_" ++ @tagName(w) ++ "_ms"), - } }), + .message_linger => try out.print("{s} {d}\n", .{ setting.word, state.message_linger_ms }), .shell => { const chosen = state.shell.requested.get(); try out.print("{s} {s}\n", .{ setting.word, if (chosen.len == 0) context.compiled_default_shell else chosen }); @@ -1393,11 +1368,10 @@ pub const Runtime = struct { }; const values = [_][2][]const u8{ .{ "TaglineSize", "73" }, .{ "WindowOpacity", "85" }, .{ "WindowBlur", "40" }, - .{ "MessageLinger", "1500" }, .{ "MessageFall", "1500" }, .{ "MessageDissolve", "1500" }, - .{ "DumpDir", "~/dumps" }, .{ "TermImages", "petscii" }, .{ "JumpScope", "all" }, - .{ "SearchPlace", "column" }, .{ "SearchPane", "new" }, .{ "Motion", "playful" }, - .{ "GripWidth", "200" }, .{ "InactiveDim", "35" }, .{ "CallstackDepth", "16" }, - .{ "Tab", "8" }, .{ "SearchRows", "12" }, + .{ "MessageLinger", "1500" }, .{ "DumpDir", "~/dumps" }, .{ "TermImages", "petscii" }, + .{ "JumpScope", "all" }, .{ "SearchPlace", "column" }, .{ "SearchPane", "new" }, + .{ "Motion", "playful" }, .{ "GripWidth", "200" }, .{ "InactiveDim", "35" }, + .{ "CallstackDepth", "16" }, .{ "Tab", "8" }, .{ "SearchRows", "12" }, }; for (values) |v| try std.testing.expect(apply(&state, find(v[0]).?, v[1])); try std.testing.expect(state.font.requested_name.set("Wanted Mono")); |
