mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 13:04:38 +02:00
Fix soft hyphens not being preserved when round tripping text through the terminal
Also roundtrip all characters in the Cf category. Characters with the DI (Default Ignorable) property are now preserved but not rendered and treated as zero-width as per the unicode standard. See https://www.unicode.org/faq/unsup_char.html
This commit is contained in:
@@ -369,6 +369,7 @@ class TestDataTypes(BaseTest):
|
||||
self.ae(wcswidth('\U0001F1E6a\U0001F1E8a'), 6)
|
||||
self.ae(wcswidth('\U0001F1E6\U0001F1E8a'), 3)
|
||||
self.ae(wcswidth('\U0001F1E6\U0001F1E8\U0001F1E6'), 4)
|
||||
self.ae(wcswidth('a\u00adb'), 2)
|
||||
# Regional indicator symbols (unicode flags) are defined as having
|
||||
# Emoji_Presentation so must have width 2
|
||||
self.ae(tuple(map(w, '\U0001f1ee\U0001f1f3')), (2, 2))
|
||||
|
||||
@@ -513,6 +513,15 @@ class TestScreen(BaseTest):
|
||||
self.ae(s.text_for_selection(), expected)
|
||||
s.scroll(2, True)
|
||||
self.ae(s.text_for_selection(), expected)
|
||||
s.reset()
|
||||
|
||||
def test_soft_hyphen(self):
|
||||
s = self.create_screen()
|
||||
s.draw('a\u00adb')
|
||||
self.ae(s.cursor.x, 2)
|
||||
s.start_selection(0, 0)
|
||||
s.update_selection(2, 0)
|
||||
self.ae(s.text_for_selection(), ('a\u00adb',))
|
||||
|
||||
def test_variation_selectors(self):
|
||||
s = self.create_screen()
|
||||
|
||||
Reference in New Issue
Block a user