Merge branch 'scroll-region-scrollback' of https://github.com/romkatv/kitty
This commit is contained in:
commit
f5b2a60549
@ -999,8 +999,8 @@ index_selection(const Screen *self, Selections *selections, bool up) {
|
||||
if (self->overlay_line.is_active) deactivate_overlay_line(self); \
|
||||
linebuf_index(self->linebuf, top, bottom); \
|
||||
INDEX_GRAPHICS(-1) \
|
||||
if (self->linebuf == self->main_linebuf && bottom == self->lines - 1) { \
|
||||
/* Only add to history when no page margins have been set */ \
|
||||
if (self->linebuf == self->main_linebuf && self->margin_top == 0) { \
|
||||
/* Only add to history when no top margin has been set */ \
|
||||
linebuf_init_line(self->linebuf, bottom); \
|
||||
historybuf_add_line(self->historybuf, self->linebuf->line, &self->as_ansi_buf); \
|
||||
self->history_line_added_count++; \
|
||||
|
||||
@ -683,3 +683,37 @@ class TestScreen(BaseTest):
|
||||
self.ae(s.current_url_text(), '123abcxyz')
|
||||
self.ae('2', s.hyperlink_at(1, 3))
|
||||
self.ae(s.current_url_text(), 'Z Z')
|
||||
|
||||
def test_bottom_margin(self):
|
||||
return
|
||||
s = self.create_screen(cols=80, lines=6, scrollback=4)
|
||||
s.set_margins(0, 5)
|
||||
for i in range(8):
|
||||
s.draw(str(i))
|
||||
s.linefeed()
|
||||
s.carriage_return()
|
||||
|
||||
self.ae(str(s.linebuf), '4\n5\n6\n7\n\n')
|
||||
self.ae(str(s.historybuf), '3\n2\n1\n0')
|
||||
|
||||
def test_top_margin(self):
|
||||
s = self.create_screen(cols=80, lines=6, scrollback=4)
|
||||
s.set_margins(2, 6)
|
||||
for i in range(8):
|
||||
s.draw(str(i))
|
||||
s.linefeed()
|
||||
s.carriage_return()
|
||||
|
||||
self.ae(str(s.linebuf), '0\n4\n5\n6\n7\n')
|
||||
self.ae(str(s.historybuf), '')
|
||||
|
||||
def test_top_and_bottom_margin(self):
|
||||
s = self.create_screen(cols=80, lines=6, scrollback=4)
|
||||
s.set_margins(2, 5)
|
||||
for i in range(8):
|
||||
s.draw(str(i))
|
||||
s.linefeed()
|
||||
s.carriage_return()
|
||||
|
||||
self.ae(str(s.linebuf), '0\n5\n6\n7\n\n')
|
||||
self.ae(str(s.historybuf), '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user