Commit Diff


commit - 23721109e309187ba1da65d068dc11ccf30fe835
commit + 2bd27830c40bfb172dab5ebb617c18ac19180a19
blob - c90730d590e4ba7275acd95c527f87e190991447
blob + f8c398afd838489e74e63c1a40ff7e693b442965
--- tog/tog.c
+++ tog/tog.c
@@ -50,6 +50,11 @@
 #define	MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b))
 #endif
 
+#ifndef MAX
+#define	MAX(_a,_b) ((_a) > (_b) ? (_a) : (_b))
+#endif
+
+
 #ifndef nitems
 #define nitems(_a)	(sizeof((_a)) / sizeof((_a)[0]))
 #endif
@@ -344,9 +349,9 @@ view_open(int nlines, int ncols, int begin_y, int begi
 static int
 view_split_begin_x(int begin_x)
 {
-	if (begin_x > 0)
+	if (begin_x > 0 || COLS < 120)
 		return 0;
-	return (COLS >= 120 ? COLS/2 : 0);
+	return (COLS - MAX(COLS / 2, 80));
 }
 
 static const struct got_error *view_resize(struct tog_view *);