mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
More efficient memory layout for Line
This commit is contained in:
@@ -13,8 +13,7 @@ class BaseTest(TestCase):
|
||||
def set_text_in_line(line, text, offset=0):
|
||||
pos = offset
|
||||
for ch in text:
|
||||
line.char[pos] = ord(ch)
|
||||
line.width[pos] = 1
|
||||
line.set_char(pos, ch)
|
||||
pos += 1
|
||||
if pos >= len(line):
|
||||
break
|
||||
|
||||
@@ -61,3 +61,14 @@ class TestDataTypes(BaseTest):
|
||||
l = lo.copy()
|
||||
l.left_shift(7, 3)
|
||||
self.ae(str(l), t)
|
||||
|
||||
l = Line(1)
|
||||
l.set_decoration(0, 2)
|
||||
q = Cursor()
|
||||
for x in 'bold italic reverse strikethrough'.split():
|
||||
getattr(l, 'set_' + x)(0, True)
|
||||
setattr(q, x, True)
|
||||
q.decoration = 2
|
||||
l.set_decoration(0, q.decoration)
|
||||
c = l.cursor_from(0)
|
||||
self.ae(c, q)
|
||||
|
||||
Reference in New Issue
Block a user