diff options
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 5186ac55..26d6c770 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -23,9 +23,6 @@ pub const frontend: config.Runtime.Capabilities = .{ .tagline_font_size = pardes.platform != .tui, .window_opacity = pardes.platform == .gui or pardes.platform == .macos, .window_blur = pardes.platform == .macos, - // Only the SDL shell shapes with HarfBuzz and honours the setting. macOS - // draws CoreText ligatures of its own, but nothing there reads it yet. - .ligatures = pardes.platform == .gui, // The grip's width, the cursor's blink and the Pet are the SDL window's. .pixels = pardes.platform == .gui, }; @@ -35,8 +32,8 @@ pub const frontend: config.Runtime.Capabilities = .{ /// its own frontend does (`viewCapabilities`), so a terminal's replica of a /// window's session steps as the window's own does, and back. pub const desktop = pardes.platform == .tui or pardes.platform == .gui; -const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .window_blur = false, .ligatures = true, .pixels = true }; -const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .window_blur = false, .ligatures = false, .pixels = false }; +const window_capabilities: config.Runtime.Capabilities = .{ .font_picker = true, .tagline_font_size = true, .window_opacity = true, .window_blur = false, .pixels = true }; +const terminal_capabilities: config.Runtime.Capabilities = .{ .font_picker = false, .tagline_font_size = false, .window_opacity = false, .window_blur = false, .pixels = false }; /// The words this build has: a desktop build's are the window's. pub const capabilities: config.Runtime.Capabilities = if (desktop) window_capabilities else frontend; @@ -488,33 +485,6 @@ test "Look does not announce itself on the message row; Del still does" { try std.testing.expect(registry.announces(Builtin.Del)); } -test "Ligatures is a setting only in the shell that shapes text" { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); - defer p.deinit(); - // A desktop build has the word, which a window's view takes alone. - try std.testing.expectEqual(desktop, @hasField(registry.Builtin(), "Ligatures")); - const exists = registry.here(p, .Ligatures); - try std.testing.expectEqual(pardes.platform == .gui, exists); - // Taken either way: run, or said to be GUI-only. - try std.testing.expect(p.executeBuiltinLine(p.active, "Ligatures off")); - try std.testing.expectEqual(!exists, p.settings.ligatures); - var storage: [8192]u8 = undefined; - var out: std.Io.Writer = .fixed(&storage); - try config.Runtime.writeReport(&out, .{ - .startup_config_path = null, - .platform = @tagName(pardes.platform), - .theme_name = p.theme().name, - .compiled_default_shell = config.defaultShell(), - .hover_delay_frames = config.look_preview_delay_frames, - .native_images = false, - .capabilities = viewCapabilities(p), - .state = &p.settings, - }); - try std.testing.expectEqual(exists, std.mem.indexOf(u8, storage[0..out.end], "Ligatures off\n") != null); - // A GUI-only setting reads so elsewhere, as every one the shell lacks. - try std.testing.expectEqual(!exists, std.mem.indexOf(u8, storage[0..out.end], "Ligatures unsupported\n") != null); -} - // ---- the two acme verbs ---- /// Look at its argument: open the file or address it names, else find the word, as a right click does. |
