mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 00:38:10 +02:00
Fix a regression that broke rendering of unicode regional indicators
At some point, unicode regional indicators became combining chars in the unicode standard, which broke the handling of them in draw_codepoint(). The fix has the added advantage of improving performance in the common case by only checking for combining chars. The flag check happens only if the first check matches. Fixes #4407
This commit is contained in:
@@ -110,6 +110,17 @@ class TestScreen(BaseTest):
|
||||
self.ae(str(s.line(0)), q)
|
||||
self.ae(s.cursor.x, 2)
|
||||
|
||||
def test_regional_indicators(self):
|
||||
s = self.create_screen()
|
||||
flag = '\U0001f1ee\U0001f1f3'
|
||||
s.draw(flag)
|
||||
self.ae(str(s.line(0)), flag)
|
||||
self.ae(s.cursor.x, 2)
|
||||
s = self.create_screen()
|
||||
s.draw('a'), s.draw(flag[0]), s.draw('b')
|
||||
self.ae(str(s.line(0)), 'a' + flag[0] + 'b')
|
||||
self.ae(s.cursor.x, 4)
|
||||
|
||||
def test_zwj(self):
|
||||
s = self.create_screen(cols=20)
|
||||
q = '\U0001f468\u200d\U0001f469\u200d\U0001f467\u200d\U0001f466'
|
||||
|
||||
Reference in New Issue
Block a user