We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afcc5c5 commit 9e7f363Copy full SHA for 9e7f363
rich/cells.py
@@ -1,15 +1,19 @@
1
from __future__ import annotations
2
3
-import re
4
from functools import lru_cache
5
from typing import Callable
6
7
from ._cell_widths import CELL_WIDTHS
8
9
-# Regex to match sequence of the most common character ranges
10
-_is_single_cell_widths = re.compile(
11
- "^[\u0020-\u007e\u00a0-\u02ff\u0370-\u0482\u2500-\u25FF]*$"
12
-).match
+_SINGLE_CELLS = frozenset(
+ [
+ *map(chr, range(0x20, 0x7E + 1)),
+ *map(chr, range(0xA0, 0x02FF + 1)),
+ *map(chr, range(0x0370, 0x0482 + 1)),
13
+ *map(chr, range(0x2500, 0x25FF + 1)),
14
+ ]
15
+)
16
+_is_single_cell_widths = _SINGLE_CELLS.issuperset
17
18
19
@lru_cache(4096)
0 commit comments