mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 07:24:41 +02:00
When erasing in display upto cursor, the line containing the cursor should be marked as not continued.
Also add some tests for the action of ED on continued flags
This commit is contained in:
@@ -1195,6 +1195,7 @@ screen_erase_in_display(Screen *self, unsigned int how, bool private) {
|
|||||||
}
|
}
|
||||||
if (how != 2) {
|
if (how != 2) {
|
||||||
screen_erase_in_line(self, how, private);
|
screen_erase_in_line(self, how, private);
|
||||||
|
if (how == 1) linebuf_mark_line_as_not_continued(self->linebuf, self->cursor->y);
|
||||||
}
|
}
|
||||||
if (how == 3 && self->linebuf == self->main_linebuf) {
|
if (how == 3 && self->linebuf == self->main_linebuf) {
|
||||||
historybuf_clear(self->historybuf);
|
historybuf_clear(self->historybuf);
|
||||||
|
|||||||
@@ -176,21 +176,29 @@ class TestScreen(BaseTest):
|
|||||||
def all_lines(s):
|
def all_lines(s):
|
||||||
return tuple(str(s.line(i)) for i in range(s.lines))
|
return tuple(str(s.line(i)) for i in range(s.lines))
|
||||||
|
|
||||||
|
def continuations(s):
|
||||||
|
return tuple(s.line(i).is_continued() for i in range(s.lines))
|
||||||
|
|
||||||
init()
|
init()
|
||||||
s.erase_in_display()
|
s.erase_in_display(0)
|
||||||
self.ae(all_lines(s), ('12345', '12', '', '', ''))
|
self.ae(all_lines(s), ('12345', '12', '', '', ''))
|
||||||
|
self.ae(continuations(s), (False, True, False, False, False))
|
||||||
|
|
||||||
init()
|
init()
|
||||||
s.erase_in_display(1)
|
s.erase_in_display(1)
|
||||||
self.ae(all_lines(s), ('', ' 45', '12345', '12345', '12345'))
|
self.ae(all_lines(s), ('', ' 45', '12345', '12345', '12345'))
|
||||||
|
self.ae(continuations(s), (False, False, True, True, True))
|
||||||
|
|
||||||
init()
|
init()
|
||||||
s.erase_in_display(2)
|
s.erase_in_display(2)
|
||||||
self.ae(all_lines(s), ('', '', '', '', ''))
|
self.ae(all_lines(s), ('', '', '', '', ''))
|
||||||
self.assertTrue(s.line(0).cursor_from(1).bold)
|
self.assertTrue(s.line(0).cursor_from(1).bold)
|
||||||
|
self.ae(continuations(s), (False, False, False, False, False))
|
||||||
|
|
||||||
init()
|
init()
|
||||||
s.erase_in_display(2, True)
|
s.erase_in_display(2, True)
|
||||||
self.ae(all_lines(s), ('', '', '', '', ''))
|
self.ae(all_lines(s), ('', '', '', '', ''))
|
||||||
|
self.ae(continuations(s), (False, False, False, False, False))
|
||||||
self.assertFalse(s.line(0).cursor_from(1).bold)
|
self.assertFalse(s.line(0).cursor_from(1).bold)
|
||||||
|
|
||||||
def test_cursor_movement(self):
|
def test_cursor_movement(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user