commit - 6141756554c6ee1a8a23728658279ef5e16262a0
commit + 6131ff18e81056001a823f913094a92c10580cba
blob - d375738b1b19d5bba6c0e4fe547d3ddbf4bb8ec9
blob + 89cccde0f2eae2e05d0e8be40c9c6e25e6c7fabe
--- tog/tog.c
+++ tog/tog.c
return view->parent == NULL;
}
+static int
+view_is_splitscreen(struct tog_view *view)
+{
+ return view->begin_x > 0;
+}
+
+
static const struct got_error *
view_resize(struct tog_view *view)
{
else
ncols = view->ncols + (COLS - view->cols);
- if (view->child) {
+ if (view->child && view_is_splitscreen(view->child)) {
view->child->begin_x = view_split_begin_x(view->begin_x);
if (view->child->begin_x == 0) {
ncols = COLS;
return view_resize(view);
}
-static int
-view_is_splitscreen(struct tog_view *view)
-{
- return view->begin_x > 0;
-}
-
static void
tog_resizeterm(void)
{
view->focussed = 0;
view->parent->focussed = 1;
view->parent->focus_child = 0;
+ if (!view_is_splitscreen(view))
+ err = view_fullscreen(view->parent);
}
break;
case 'q':
err = view_fullscreen(view);
} else {
err = view_splitscreen(view);
+ if (!err)
+ err = view_resize(view->parent);
}
if (err)
break;