mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-03 22:28:38 +00:00
move runIterator options to dedicated struct
This commit is contained in:
@@ -2,6 +2,9 @@ const builtin = @import("builtin");
|
||||
const options = @import("main.zig").options;
|
||||
const run = @import("shaper/run.zig");
|
||||
const feature = @import("shaper/feature.zig");
|
||||
const configpkg = @import("../config.zig");
|
||||
const terminal = @import("../terminal/main.zig");
|
||||
const SharedGrid = @import("main.zig").SharedGrid;
|
||||
pub const noop = @import("shaper/noop.zig");
|
||||
pub const harfbuzz = @import("shaper/harfbuzz.zig");
|
||||
pub const coretext = @import("shaper/coretext.zig");
|
||||
@@ -61,6 +64,38 @@ pub const Options = struct {
|
||||
features: []const []const u8 = &.{},
|
||||
};
|
||||
|
||||
/// Options for runIterator.
|
||||
pub const RunOptions = struct {
|
||||
/// The font state for the terminal screen. This is mutable because
|
||||
/// cached values may be updated during shaping.
|
||||
grid: *SharedGrid,
|
||||
|
||||
/// The terminal screen to shape.
|
||||
screen: *const terminal.Screen,
|
||||
|
||||
/// The row within the screen to shape. This row must exist within
|
||||
/// screen; it is not validated.
|
||||
row: terminal.Pin,
|
||||
|
||||
/// The selection boundaries. This is used to break shaping on
|
||||
/// selection boundaries. This can be disabled by setting this to
|
||||
/// null.
|
||||
selection: ?terminal.Selection = null,
|
||||
|
||||
/// The cursor position within this row. This is used to break shaping
|
||||
/// on cursor boundaries. This can be disabled by setting this to
|
||||
/// null.
|
||||
cursor_x: ?usize = null,
|
||||
|
||||
/// Apply the font break configuration to the run.
|
||||
pub fn applyBreakConfig(
|
||||
self: *RunOptions,
|
||||
config: configpkg.FontShapingBreak,
|
||||
) void {
|
||||
if (!config.cursor) self.cursor_x = null;
|
||||
}
|
||||
};
|
||||
|
||||
test {
|
||||
_ = Cache;
|
||||
_ = Shaper;
|
||||
|
||||
Reference in New Issue
Block a user