mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-28 10:01:38 +00:00
fast getX(.is_symbol)
This commit is contained in:
@@ -90,6 +90,29 @@ const grapheme_boundary_class = config.Extension{
|
||||
},
|
||||
};
|
||||
|
||||
fn computeIsSymbol(cp: u21, data: anytype, backing: anytype, tracking: anytype) void {
|
||||
_ = cp;
|
||||
_ = backing;
|
||||
_ = tracking;
|
||||
const block = data.block;
|
||||
data.is_symbol = data.general_category == .other_private_use or
|
||||
block == .dingbats or
|
||||
block == .emoticons or
|
||||
block == .miscellaneous_symbols or
|
||||
block == .enclosed_alphanumerics or
|
||||
block == .enclosed_alphanumeric_supplement or
|
||||
block == .miscellaneous_symbols_and_pictographs or
|
||||
block == .transport_and_map_symbols;
|
||||
}
|
||||
|
||||
const is_symbol = config.Extension{
|
||||
.inputs = &.{ "block", "general_category" },
|
||||
.compute = &computeIsSymbol,
|
||||
.fields = &.{
|
||||
.{ .name = "is_symbol", .type = bool },
|
||||
},
|
||||
};
|
||||
|
||||
pub const tables = [_]config.Table{
|
||||
.{
|
||||
.extensions = &.{wcwidth},
|
||||
@@ -113,4 +136,10 @@ pub const tables = [_]config.Table{
|
||||
grapheme_boundary_class.field("grapheme_boundary_class"),
|
||||
},
|
||||
},
|
||||
.{
|
||||
.extensions = &.{is_symbol},
|
||||
.fields = &.{
|
||||
is_symbol.field("is_symbol"),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user