Skip to content

comptime values #99

@Cohors1316

Description

@Cohors1316

Having looked through most of the source I'm seeing several potential changes that could simplify things for users. A simple one would be changing the static function colors into consts, this would simplify var style = (zz.Style{}).fg(zz.Color.blue()); to var style = (zz.Style{}).fg(.blue);.

Similarly for border defaults, by removing the Border struct that held the defaults for BorderChar and placing those const defaults into BorderChar directly we can use result location semantics for those, so border options could be declared as (.full).

For new styles, if you don't mind a slight deviation from zig casing zz.Style could be changed to

pub fn Style() style.Style {
    return .{};
}

Which would change declarations to

var style = zz.Style().fg(.red)...;

as opposed to the current (zz.Style{}). If not then a zz.newStyle() inside root.zig would be convenient.

I have these on a branch already, but as they change external api I'm just going to hold them unless you want them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions