Refactor the cell rendering code for greater re-use

Also start work on CoreText based rendering
This commit is contained in:
Kovid Goyal
2017-01-11 12:02:28 +05:30
parent 282d6faa5f
commit dff91759a2
6 changed files with 204 additions and 81 deletions
+5
View File
@@ -8,6 +8,7 @@ import signal
import shlex
import subprocess
import ctypes
import math
from collections import namedtuple
from contextlib import contextmanager
from functools import lru_cache
@@ -30,6 +31,10 @@ def safe_print(*a, **k):
pass
def ceil_int(x):
return int(math.ceil(x))
@lru_cache(maxsize=2**13)
def wcwidth(c: str) -> int:
ans = min(2, wcwidth_native(c))