From 5c160d0973a79a7f616bc56284e6a0fc40d8a22d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 8 Dec 2016 21:03:55 +0530 Subject: [PATCH] Fix crash when rendering char whose wcwidth == 2 but whose bitmap fits in a single cell --- kitty/fonts/freetype.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kitty/fonts/freetype.py b/kitty/fonts/freetype.py index ba089448a..67285b4e2 100644 --- a/kitty/fonts/freetype.py +++ b/kitty/fonts/freetype.py @@ -197,8 +197,11 @@ def render_cell(text=' ', bold=False, italic=False, underline=0, strikethrough=F bitmap_char = render_char(text, bold, italic, width) second = None if width == 2: - bitmap_char, second = split_char_bitmap(bitmap_char) - second = place_char_in_cell(second) + if bitmap_char.columns > cell_width: + bitmap_char, second = split_char_bitmap(bitmap_char) + second = place_char_in_cell(second) + else: + second = render_cell() first = place_char_in_cell(bitmap_char)