From e976cf67fd20ac67e15d794fd6cbfe2ce811f18a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 9 Apr 2025 19:57:34 +0530 Subject: [PATCH] Make GraphemeBreakProperty available globally --- gen/wcwidth.py | 4 ++-- kitty/char-props-data.h | 19 ------------------- kitty/char-props.h | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gen/wcwidth.py b/gen/wcwidth.py index e91dd1f6e..3f2388767 100755 --- a/gen/wcwidth.py +++ b/gen/wcwidth.py @@ -1177,10 +1177,10 @@ def gen_char_props() -> None: gp('import "unsafe"') gp(f'const MAX_UNICODE = {sys.maxunicode}') gp(f'const UNICODE_LIMIT = {sys.maxunicode + 1}') - generate_enum(c, gp, 'GraphemeBreakProperty', *grapheme_segmentation_maps, prefix='GBP_') - generate_enum(c, gp, 'IndicConjunctBreak', *incb_map, prefix='ICB_') cen('// UCBDeclaration {{''{') cen(f'#define MAX_UNICODE ({sys.maxunicode}u)') + generate_enum(cen, gp, 'GraphemeBreakProperty', *grapheme_segmentation_maps, prefix='GBP_') + generate_enum(c, gp, 'IndicConjunctBreak', *incb_map, prefix='ICB_') generate_enum(cen, gp, 'UnicodeCategory', 'Cn', *class_maps, prefix='UC_') cen('// EndUCBDeclaration }}''}') gp(make_bitfield('tools/wcswidth', 'CharProps', *CharProps.go_fields(), add_package=False)[1]) diff --git a/kitty/char-props-data.h b/kitty/char-props-data.h index 50ccceebc..9610d1ca2 100644 --- a/kitty/char-props-data.h +++ b/kitty/char-props-data.h @@ -3,25 +3,6 @@ #pragma once -typedef enum GraphemeBreakProperty { - GBP_AtStart, - GBP_None, - GBP_Prepend, - GBP_CR, - GBP_LF, - GBP_Control, - GBP_Extend, - GBP_Regional_Indicator, - GBP_SpacingMark, - GBP_L, - GBP_V, - GBP_T, - GBP_LV, - GBP_LVT, - GBP_ZWJ, - GBP_Private_Expecting_RI, -} GraphemeBreakProperty; - typedef enum IndicConjunctBreak { ICB_None, ICB_Linker, diff --git a/kitty/char-props.h b/kitty/char-props.h index 62a0e0acd..1b13d27a3 100644 --- a/kitty/char-props.h +++ b/kitty/char-props.h @@ -105,6 +105,25 @@ static_assert(sizeof(GraphemeSegmentationResult) == sizeof(uint16_t), "Fix the o // UCBDeclaration {{{ #define MAX_UNICODE (1114111u) +typedef enum GraphemeBreakProperty { + GBP_AtStart, + GBP_None, + GBP_Prepend, + GBP_CR, + GBP_LF, + GBP_Control, + GBP_Extend, + GBP_Regional_Indicator, + GBP_SpacingMark, + GBP_L, + GBP_V, + GBP_T, + GBP_LV, + GBP_LVT, + GBP_ZWJ, + GBP_Private_Expecting_RI, +} GraphemeBreakProperty; + typedef enum UnicodeCategory { UC_Cn, UC_Cc,