Implement restitch during rewrap

Faster, less code and gets us multicell handling during restitching for
free.
This commit is contained in:
Kovid Goyal
2024-12-30 08:00:01 +05:30
parent b3c39f4921
commit c4a32862d1
4 changed files with 37 additions and 102 deletions

View File

@@ -357,8 +357,10 @@ class TestScreen(BaseTest):
s = self.create_screen(scrollback=20)
s.draw(''.join(str(i) * s.columns for i in range(s.lines*2)))
self.ae(str(s.linebuf), '55555\n66666\n77777\n88888\n99999')
before = at()
s.resize(5, 2)
self.ae(str(s.linebuf), '88\n88\n99\n99\n9')
self.ae(before, at())
self.ae(str(s.linebuf), '88\n88\n89\n99\n99')
s = self.create_screen()
s.draw('a' * s.columns)
s.linefeed(), s.carriage_return()