Fix top lines appearing at bottom when resizing a screen that seen more lines than the number of lines available

This commit is contained in:
Kovid Goyal 2016-12-12 10:58:18 +05:30
parent b6c639c487
commit 271e3360ff
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@
linebuf_init_line(dest, dest->ynum - 1); \
historybuf_add_line(historybuf, dest->line); \
}\
linebuf_clear_line(dest, dest->ynum - 1); \
} else dest_y++; \
init_dest_line(dest_y); \
dest->continued_map[dest_y] = continued;

View File

@ -246,6 +246,11 @@ class TestScreen(BaseTest):
for i in range(s.lines):
self.ae(str(hb.line(i)), '3')
self.ae(str(hb.line(5)), '2')
s = self.create_screen(scrollback=6)
s.draw(''.join([str(i) * s.columns for i in range(s.lines*2)]))
self.ae(str(s.line(4)), '9'*5)
s.resize(5, 2)
self.ae(str(s.line(4)), '9 ')
def test_tab_stops(self):
# Taken from vttest/main.c