summaryrefslogtreecommitdiff
path: root/tests/extern/kitty
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extern/kitty')
-rw-r--r--tests/extern/kitty/screen.py14
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):