mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 04:32:05 +00:00
Forgot to handle case of empty scrollback
This commit is contained in:
parent
3c39cbf333
commit
d782654819
1 changed files with 3 additions and 2 deletions
|
|
@ -1143,9 +1143,10 @@ _reverse_scroll(Screen *self, unsigned int count, bool fill_from_scrollback) {
|
|||
unsigned int top = self->margin_top, bottom = self->margin_bottom;
|
||||
fill_from_scrollback = fill_from_scrollback && self->linebuf == self->main_linebuf;
|
||||
while (count-- > 0) {
|
||||
if (fill_from_scrollback) historybuf_pop_line(self->historybuf, self->alt_linebuf->line);
|
||||
bool copied = false;
|
||||
if (fill_from_scrollback) copied = historybuf_pop_line(self->historybuf, self->alt_linebuf->line);
|
||||
INDEX_DOWN;
|
||||
if (fill_from_scrollback) linebuf_copy_line_to(self->main_linebuf, self->alt_linebuf->line, 0);
|
||||
if (copied) linebuf_copy_line_to(self->main_linebuf, self->alt_linebuf->line, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue