From dc5037ff37a57b5e2fac9a6b3965932f5c7c8b73 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 31 Dec 2024 13:26:27 +0530 Subject: [PATCH] Add tests for multicell char split between history and line buffers --- kitty_tests/multicell.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py index f3b79abfc..77a70d892 100644 --- a/kitty_tests/multicell.py +++ b/kitty_tests/multicell.py @@ -461,10 +461,12 @@ def test_multicell(self: TestMulticell) -> None: ta('\x1b]66;w=1:s=3;a\x07\x1b]66;w=1:s=2;b\x07') # rewrap with multicells + s = self.create_screen(cols=6, lines=6, scrollback=20) o = s.lines, s.columns def reset(): s.resize(*o) s.reset() + s.clear_scrollback() def mc(x=None, y=None): if x is not None: @@ -571,3 +573,21 @@ def test_multicell(self: TestMulticell) -> None: s.draw('1'), multicell(s, 'X', width=4), s.draw('abc') resize(3, 3, 5, 0) self.ae('\x1b[m1ab\x1b[mc', as_ansi().rstrip()) # ]]]]]]] + + reset() + multicell(s, 'X', scale=4), s.draw('112233445555556666667') + self.ae(str(s.historybuf), 'X11') # X is split between the buffers + resize(6, s.columns+1, 0, 5) + self.ae(str(s.historybuf), 'X112') + self.ae(str(s.linebuf.line(0)), 'X233') + for y in range(3): + for x in range(4): + ac(x, y, is_multicell=True) + reset() + multicell(s, 'X', scale=4), s.draw('112233445555556666667') + resize(6, s.columns-1, 0, 5) + self.ae(str(s.historybuf), 'X1\nX1') + self.ae(str(s.linebuf.line(0)), 'X2') + for y in range(2): + for x in range(4): + ac(x, y, is_multicell=True)