mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-27 02:56:28 +00:00
introduce split-preserve-zoom config to maintain zoomed splits during navigation
This commit is contained in:
committed by
Mitchell Hashimoto
parent
67eb480577
commit
d364e421a8
@@ -985,6 +985,14 @@ palette: Palette = .{},
|
||||
/// Available since: 1.1.0
|
||||
@"split-divider-color": ?Color = null,
|
||||
|
||||
/// Control when Ghostty preserves the zoomed state of a split. This is a packed
|
||||
/// struct so more options can be added in the future. The `navigation` option
|
||||
/// keeps the current split zoomed when split navigation (`goto_split`) changes
|
||||
/// the focused split.
|
||||
///
|
||||
/// Example: `split-preserve-zoom = navigation`
|
||||
@"split-preserve-zoom": SplitPreserveZoom = .{},
|
||||
|
||||
/// The foreground and background color for search matches. This only applies
|
||||
/// to non-focused search matches, also known as candidate matches.
|
||||
///
|
||||
@@ -7423,6 +7431,10 @@ pub const ShellIntegrationFeatures = packed struct {
|
||||
path: bool = true,
|
||||
};
|
||||
|
||||
pub const SplitPreserveZoom = packed struct {
|
||||
navigation: bool = false,
|
||||
};
|
||||
|
||||
pub const RepeatableCommand = struct {
|
||||
value: std.ArrayListUnmanaged(inputpkg.Command) = .empty,
|
||||
|
||||
|
||||
@@ -222,3 +222,19 @@ test "c_get: background-blur" {
|
||||
try testing.expectEqual(-2, cval);
|
||||
}
|
||||
}
|
||||
|
||||
test "c_get: split-preserve-zoom" {
|
||||
const testing = std.testing;
|
||||
const alloc = testing.allocator;
|
||||
|
||||
var c = try Config.default(alloc);
|
||||
defer c.deinit();
|
||||
|
||||
var bits: c_uint = undefined;
|
||||
try testing.expect(get(&c, .@"split-preserve-zoom", @ptrCast(&bits)));
|
||||
try testing.expectEqual(@as(c_uint, 0), bits);
|
||||
|
||||
c.@"split-preserve-zoom".navigation = true;
|
||||
try testing.expect(get(&c, .@"split-preserve-zoom", @ptrCast(&bits)));
|
||||
try testing.expectEqual(@as(c_uint, 1), bits);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user