mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-26 19:01:27 +00:00
...
This commit is contained in:
parent
050cf22f24
commit
ca30bba165
1 changed files with 5 additions and 1 deletions
|
|
@ -34,7 +34,11 @@ def wcwidth(c: str) -> int:
|
|||
return 0
|
||||
if current_font_metrics is None:
|
||||
return min(2, wcwidth_native(c))
|
||||
w = current_font_metrics.widthChar(c)
|
||||
try:
|
||||
w = current_font_metrics.widthChar(c)
|
||||
except ValueError:
|
||||
# Happens for non-BMP unicode chars
|
||||
w = current_font_metrics.width(c)
|
||||
cells, extra = divmod(w, cell_width)
|
||||
if extra > 0.1 * cell_width:
|
||||
cells += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue