Commit c71ed39a66ed8e3aeaa13e76fce179b7bf6efec6

Stefan Sperling 2022-06-29T20:57:36

fix split-screen issue in tog when moving focus from child view to parent view Reported by jamsek: $ tog # term wide enough to vsplit return # open commit f # fullscreen commit tab # should go to fullscreen log, but it splits the screen fix ok jamsek

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 090dd83..89606b6 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -775,7 +775,8 @@ view_resize(struct tog_view *view)
 		ncols = view->ncols + (COLS - view->cols);
 
 	if (view->child) {
-		view->child->begin_x = view_split_begin_x(view->begin_x);
+		if (view->child->focussed)
+			view->child->begin_x = view_split_begin_x(view->begin_x);
 		if (view->child->begin_x == 0) {
 			ncols = COLS;