Commit dd04dd3fa26d7797dbf1c6e0afd6d17db799810e

Stefan Sperling 2018-08-19T12:59:01

make tog use vertical split-screen if there's enough room

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/tog/tog.c b/tog/tog.c
index 20a468b..72930de 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -268,6 +268,9 @@ view_open(int nlines, int ncols, int begin_y, int begin_x,
 	if (view == NULL)
 		return NULL;
 
+	if (begin_x == 0 && parent && parent->ncols - 80 > 10)
+		begin_x = parent->ncols - 80;
+
 	view->parent = parent;
 	view->type = type;
 	view->lines = LINES;