From f8403d4dec6af57d48df8f58b4c34056ec4d8432 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 21 Nov 2016 09:34:16 +0530 Subject: [PATCH] Fix screen being deleted on resize Also fix crash when resizing the altbuf --- kitty/rewrap.h | 6 ++++-- kitty/screen.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kitty/rewrap.h b/kitty/rewrap.h index da347dc6f..5b917eb0a 100644 --- a/kitty/rewrap.h +++ b/kitty/rewrap.h @@ -27,8 +27,10 @@ #define next_dest_line(continued) \ if (dest_y >= dest->ynum - 1) { \ linebuf_index(dest, 0, dest->ynum - 1); \ - linebuf_init_line(dest, dest->ynum - 1); \ - historybuf_add_line(historybuf, dest->line); \ + if (historybuf != NULL) { \ + linebuf_init_line(dest, dest->ynum - 1); \ + historybuf_add_line(historybuf, dest->line); \ + }\ } else dest_y++; \ init_dest_line(dest_y); \ dest->continued_map[dest_y] = continued; diff --git a/kitty/screen.c b/kitty/screen.c index 4bc19fd47..1cf2ce6c0 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -104,8 +104,6 @@ static bool screen_resize(Screen *self, unsigned int lines, unsigned int columns self->lines = lines; self->columns = columns; self->margin_top = 0; self->margin_bottom = self->lines - 1; - screen_reset_mode(self, DECOM); - // TODO: resize history buf return true; }