Commit 97ddc14653c4e9867c310b35fea2cc60193d1ed0

Stefan Sperling 2018-08-01T11:21:42

store window dimensions in tog view data structure

diff --git a/tog/tog.c b/tog/tog.c
index c0bad35..81b2d4c 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -85,6 +85,7 @@ static struct tog_cmd tog_commands[] = {
 struct tog_view {
 	WINDOW *window;
 	PANEL *panel;
+	int nlines, ncols, begin_y, begin_x;
 };
 
 static const struct got_error *
@@ -116,6 +117,10 @@ open_view(int nlines, int ncols, int begin_y, int begin_x)
 	if (view == NULL)
 		return NULL;
 
+	view->nlines = nlines;
+	view->ncols = ncols;
+	view->begin_y = begin_y;
+	view->begin_x = begin_x;
 	view->window = newwin(nlines, ncols, begin_y, begin_x);
 	if (view->window == NULL) {
 		close_view(view);