Ensure cursor is correctly positioned after emoji presentation char + VS15

cursor should be on the cell immediately after the the char since the
variation selector makes the char one cell wide.
This commit is contained in:
Kovid Goyal
2019-05-13 20:18:41 +05:30
parent fe882dad15
commit 529337e00a
2 changed files with 27 additions and 0 deletions

View File

@@ -429,6 +429,20 @@ class TestScreen(BaseTest):
s.scroll(2, True)
self.ae(s.text_for_selection(), expected)
def test_variation_selectors(self):
s = self.create_screen()
s.draw('\U0001f610')
self.ae(s.cursor.x, 2)
s.carriage_return(), s.linefeed()
s.draw('\U0001f610\ufe0e')
self.ae(s.cursor.x, 1)
s.carriage_return(), s.linefeed()
s.draw('\u25b6')
self.ae(s.cursor.x, 1)
s.carriage_return(), s.linefeed()
s.draw('\u25b6\ufe0f')
self.ae(s.cursor.x, 2)
def test_serialize(self):
s = self.create_screen()
s.draw('ab' * s.columns)