diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 11:37:31 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 11:37:31 +0300 |
| commit | af6a37b1c4509c7766933a7cb45d2ee9a3a23f98 (patch) | |
| tree | e7b0294ebf0d9b124b8885a76c119d7f46d5b0fb /tests/extern | |
| parent | acd338ea33de36d223cc6d301712eed4a9501e6c (diff) | |
Return owned text and share cell attribute flags with snapshots
Make text queries return allocated strings released with term_text_free, keeping each capture atomic. Align public attributes with the write core, remove snapshot conversion tables, and migrate tests and the Kitty adapter.
Diffstat (limited to 'tests/extern')
| -rw-r--r-- | tests/extern/kitty/screen.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/extern/kitty/screen.py b/tests/extern/kitty/screen.py index cc7289b..a3336d8 100644 --- a/tests/extern/kitty/screen.py +++ b/tests/extern/kitty/screen.py @@ -71,14 +71,13 @@ TERM_DEFAULT_BG = 0xFF1E1E2E # Cell attributes (must match enum term_attr in term.h) TERM_ATTR_BOLD = 1 << 0 TERM_ATTR_ITALIC = 1 << 1 -TERM_ATTR_FAINT = 1 << 2 +TERM_ATTR_FAINT = 1 << 10 TERM_ATTR_STRIKE = 1 << 3 TERM_ATTR_OVERLINE = 1 << 4 -TERM_ATTR_LINK = 1 << 5 -TERM_ATTR_EMOJI = 1 << 6 -TERM_ATTR_TEXT = 1 << 7 -TERM_ATTR_UNDERLINE_SHIFT = 8 -TERM_ATTR_UNDERLINE_MASK = 7 << TERM_ATTR_UNDERLINE_SHIFT +TERM_ATTR_LINK = 1 << 15 +TERM_ATTR_EMOJI = 1 << 5 +TERM_ATTR_TEXT = 1 << 6 +TERM_UNDERLINE_FLAGS = (1 << 2, 1 << 11, 1 << 12, 1 << 13, 1 << 14) # The longest grapheme cluster that a cell's text is read with. _CLUSTER_CAP = 32 @@ -276,7 +275,8 @@ class CellCursor: def decoration(self): # enum term_underline uses Kitty's numbers: 0=none, 1=straight, # 2=double, 3=curly, 4=dotted, 5=dashed. - return (self._cell.attrs & TERM_ATTR_UNDERLINE_MASK) >> TERM_ATTR_UNDERLINE_SHIFT + return next((i for i, flag in enumerate(TERM_UNDERLINE_FLAGS, 1) + if self._cell.attrs & flag), 0) @property def fg(self): |
